In [1]:
import pandas as pd
import numpy as np
from math import log

dataXXXX: clean data for one month (run membership/registered analysis)

df: complete merge data (data from Jan to Nov)

mergeX: merge data for one month (run bubble chart)

after merging there are actually 6062 unique users


In [2]:
# January

#0107
data0107 = pd.read_csv('2014-01-07_userdat.csv', sep=",")
yesterday0107 = 'January 06, 1114'
today0107 = 'January 07, 2014'
count = -1;
for each in data0107['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0107
        if 'Today' in each:
            time = today0107
        data0107.set_value(count, 'registered', time)
data0107 = data0107.dropna()

#0111
data0111 = pd.read_csv('2014-01-11_userdat.csv', sep=",")
yesterday0111 = 'January 10, 1114'
today0111 = 'January 11, 2014'
count = -1;
for each in data0111['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0111
        if 'Today' in each:
            time = today0111
        data0111.set_value(count, 'registered', time)
data0111 = data0111.dropna()


#0120
data0120 = pd.read_csv('2014-01-20_userdat.csv', sep=",")
yesterday0120 = 'January 19, 1114'
today0120 = 'January 20, 2014'
count = -1;
for each in data0120['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0120
        if 'Today' in each:
            time = today0120
        data0120.set_value(count, 'registered', time)
data0120 = data0120.dropna()


#0128
data0128 = pd.read_csv('2014-01-28_userdat.csv', sep=",")
yesterday0128 = 'January 27, 2014'
today0128 = 'January 28, 2014'
count = -1;
for each in data0128['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0128
        if 'Today' in each:
            time = today0128
        data0128.set_value(count, 'registered', time)
data0128 = data0128.dropna()

In [3]:
df_new = pd.concat([data0107, data0111])
df_new = pd.concat([df_new, data0120])
df_new = pd.concat([df_new, data0128])

In [4]:
df_new


Out[4]:
username position posts ppd up down registered
0 yama dass Vendor 6.0 0.068 1.0 0.0 October 10, 2013
1 Dread Pirate Roberts Administrator 599.0 6.511 483.0 29.0 October 07, 2013
2 IceIceIce Vendor 23.0 0.256 4.0 0.0 October 08, 2013
3 bouclelan Newbie 40.0 0.449 0.0 0.0 October 10, 2013
4 1Creator Jr. Member 81.0 2.613 7.0 3.0 December 07, 2013
5 gypsymoth Jr. Member 51.0 1.821 1.0 0.0 December 07, 2013
6 Merde222 Sr. Member 344.0 11.097 30.0 7.0 December 07, 2013
7 boogey Newbie 16.0 0.516 1.0 0.0 December 07, 2013
8 Cassiano Newbie 13.0 0.419 0.0 0.0 December 07, 2013
9 gnomodamontanha Newbie 24.0 0.273 0.0 3.0 October 10, 2013
10 ChillSpace Newbie 4.0 0.129 10.0 1.0 December 07, 2013
11 skeetlord Jr. Member 96.0 3.097 5.0 9.0 December 07, 2013
12 Comped Newbie 2.0 0.065 0.0 0.0 December 07, 2013
13 cashmonay13 Newbie 1.0 0.037 0.0 0.0 December 07, 2013
14 frostfire Newbie 41.0 1.323 2.0 1.0 December 07, 2013
15 TheProfessionals Newbie 4.0 0.129 0.0 0.0 December 07, 2013
16 mattttam132 Jr. Member 51.0 2.125 0.0 0.0 December 07, 2013
17 redcoyote_ Jr. Member 51.0 1.645 1.0 1.0 December 07, 2013
18 fuckme Newbie 1.0 0.037 0.0 2.0 December 07, 2013
19 tyrone Newbie 4.0 0.049 1.0 5.0 October 10, 2013
20 BambooPanda Newbie 3.0 0.111 0.0 0.0 December 07, 2013
21 nathan.burnett Jr. Member 94.0 3.032 25.0 4.0 December 07, 2013
22 lab5ive Jr. Member 51.0 0.638 2.0 0.0 October 10, 2013
23 crystal Newbie 4.0 0.045 0.0 0.0 October 10, 2013
24 pumpgalaxyy Newbie 0.0 0.000 0.0 0.0 December 07, 2013
25 pampa11 Newbie 6.0 0.194 0.0 0.0 December 07, 2013
26 Matey Full Member 105.0 3.889 2.0 13.0 December 07, 2013
27 Mr. Nice Vendor 181.0 2.057 9.0 3.0 October 10, 2013
28 xtrxitteh Newbie 0.0 0.000 0.0 0.0 December 07, 2013
29 abrotherisjust Newbie 8.0 0.258 0.0 0.0 December 07, 2013
... ... ... ... ... ... ... ...
4609 byebyesheep1 Newbie 21.0 0.404 1.0 9.0 December 05, 2013
4610 GreenGrandpa Vendor 3.0 0.028 0.0 0.0 October 09, 2013
4611 HimalayanBlues Vendor 78.0 1.164 12.0 1.0 November 21, 2013
4612 SantanaEscobar Jr. Member 92.0 4.842 20.0 3.0 January 08, 2014
4615 Atilla Newbie 4.0 0.073 1.0 1.0 December 02, 2013
4616 fuNguyZ Newbie 7.0 0.103 1.0 0.0 November 19, 2013
4618 wakemeup Newbie 18.0 0.162 1.0 1.0 October 08, 2013
4620 MisterMan Jr. Member 51.0 1.889 0.0 0.0 December 31, 2013
4621 snooze Jr. Member 63.0 0.578 32.0 10.0 October 10, 2013
4622 BrownBagSwag Newbie 1.0 0.011 0.0 0.0 October 31, 2013
4623 Moonmanisback Newbie 48.0 0.696 0.0 2.0 November 19, 2013
4624 joenamath Jr. Member 64.0 6.400 0.0 3.0 January 16, 2014
4625 TheJawBone Newbie 45.0 0.634 7.0 2.0 November 17, 2013
4626 BB22 Jr. Member 51.0 2.217 0.0 0.0 January 03, 2014
4627 heepdeep Newbie 37.0 0.860 2.0 0.0 December 14, 2013
4628 protoalgae Newbie 11.0 1.222 1.0 0.0 January 18, 2014
4629 hotrainbow Newbie 0.0 0.000 0.0 0.0 January 06, 2014
4630 bingoplayer Newbie 15.0 0.185 0.0 0.0 November 06, 2013
4631 theabsolutefinest Vendor 20.0 0.189 2.0 5.0 October 13, 2013
4632 danjango1 Jr. Member 61.0 0.629 3.0 2.0 October 22, 2013
4633 4739254859352548 Newbie 1.0 0.016 1.0 2.0 November 26, 2013
4634 19091909 Newbie 1.0 0.014 0.0 0.0 November 18, 2013
4635 MoonBaseOne Jr. Member 71.0 11.833 0.0 0.0 January 21, 2014
4636 saturnair Newbie 1.0 0.015 0.0 0.0 November 22, 2013
4637 theanchor Vendor 8.0 0.073 3.0 1.0 October 09, 2013
4638 bl0xain Newbie 0.0 0.000 0.0 0.0 December 22, 2013
4639 waterdragon Jr. Member 55.0 5.000 2.0 0.0 January 15, 2014
4640 myoldschool Newbie 1.0 0.009 0.0 0.0 October 09, 2013
4641 ApeFootTall Jr. Member 50.0 0.847 1.0 1.0 November 27, 2013
4642 garconSR2 Newbie 10.0 1.429 3.0 0.0 January 20, 2014

13631 rows × 7 columns


In [5]:
df_1 = df_new.drop_duplicates(['username'], keep='last')

In [6]:
# February

#0208
data0208 = pd.read_csv('2014-02-08_userdat.csv', sep=",")
yesterday0208 = 'February 07, 1114'
today0208 = 'February 08, 2014'
count = -1;
for each in data0208['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0208
        if 'Today' in each:
            time = today0208
        data0208.set_value(count, 'registered', time)
data0208 = data0208.dropna()

#0217
data0217 = pd.read_csv('2014-02-17_userdat.csv', sep=",")
yesterday0217 = 'February 16, 1114'
today0217 = 'February 17, 2014'
count = -1;
for each in data0217['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0217
        if 'Today' in each:
            time = today0217
        data0217.set_value(count, 'registered', time)
data0217 = data0120.dropna()


#0221
data0221 = pd.read_csv('2014-02-21_userdat.csv', sep=",")
yesterday0221 = 'February 20, 1114'
today0221 = 'February 21, 2014'
count = -1;
for each in data0221['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0221
        if 'Today' in each:
            time = today0221
        data0221.set_value(count, 'registered', time)
data0221 = data0221.dropna()


#0224
data0224 = pd.read_csv('2014-02-24_userdat.csv', sep=",")
yesterday0224 = 'February 23, 2014'
today0224 = 'February 24, 2014'
count = -1;
for each in data0224['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0224
        if 'Today' in each:
            time = today0224
        data0224.set_value(count, 'registered', time)
data0224 = data0224.dropna()

df_new = pd.concat([data0208, data0217])
df_new = pd.concat([df_new, data0221])
df_new = pd.concat([df_new, data0224])
df_2 = df_new.drop_duplicates(['username'], keep='last')

In [7]:
# March

#0303
data0303 = pd.read_csv('2014-03-03_userdat.csv', sep=",")
yesterday0303 = 'March 02, 1114'
today0303 = 'March 03, 2014'
count = -1;
for each in data0303['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0303
        if 'Today' in each:
            time = today0303
        data0303.set_value(count, 'registered', time)
data0303 = data0303.dropna()

#0307
data0307 = pd.read_csv('2014-03-07_userdat.csv', sep=",")
yesterday0307 = 'March 06, 1114'
today0307 = 'March 07, 2014'
count = -1;
for each in data0307['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0307
        if 'Today' in each:
            time = today0307
        data0307.set_value(count, 'registered', time)
data0307 = data0307.dropna()


#0310
data0310 = pd.read_csv('2014-03-10_userdat.csv', sep=",")
yesterday0310 = 'March 09, 1114'
today0310 = 'March 10, 2014'
count = -1;
for each in data0310['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0310
        if 'Today' in each:
            time = today0310
        data0310.set_value(count, 'registered', time)
data0310 = data0310.dropna()


df_new = pd.concat([data0303, data0307])
df_new = pd.concat([df_new, data0310])
df_3 = df_new.drop_duplicates(['username'], keep='last')

In [8]:
# April

#0407
data0407 = pd.read_csv('2014-04-07_userdat.csv', sep=",")
yesterday0407 = 'April 06, 1114'
today0407 = 'April 07, 2014'
count = -1;
for each in data0407['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0407
        if 'Today' in each:
            time = today0407
        data0407.set_value(count, 'registered', time)
data0407 = data0407.dropna()

#0416
data0416 = pd.read_csv('2014-04-16_userdat.csv', sep=",")
yesterday0416 = 'April 15, 1114'
today0416 = 'April 16, 2014'
count = -1;
for each in data0416['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0416
        if 'Today' in each:
            time = today0416
        data0416.set_value(count, 'registered', time)
data0416 = data0416.dropna()


#0421
data0421 = pd.read_csv('2014-04-21_userdat.csv', sep=",")
yesterday0421 = 'April 20, 1114'
today0421 = 'April 21, 2014'
count = -1;
for each in data0421['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0421
        if 'Today' in each:
            time = today0421
        data0421.set_value(count, 'registered', time)
data0421 = data0421.dropna()

#0428
data0428 = pd.read_csv('2014-04-28_userdat.csv', sep=",")
yesterday0428 = 'April 27, 1114'
today0428 = 'April 28, 2014'
count = -1;
for each in data0428['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0428
        if 'Today' in each:
            time = today0428
        data0428.set_value(count, 'registered', time)
data0428 = data0428.dropna()


df_new = pd.concat([data0407, data0416])
df_new = pd.concat([df_new, data0421])
df_new = pd.concat([df_new, data0428])
df_4 = df_new.drop_duplicates(['username'], keep='last')

In [9]:
# May

#0503
data0503 = pd.read_csv('2014-05-03_userdat.csv', sep=",")
yesterday0503 = 'May 02, 1114'
today0503 = 'May 03, 2014'
count = -1;
for each in data0503['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0503
        if 'Today' in each:
            time = today0503
        data0503.set_value(count, 'registered', time)
data0503 = data0503.dropna()

#0510
data0510 = pd.read_csv('2014-05-10_userdat.csv', sep=",")
yesterday0510 = 'May 09, 1114'
today0510 = 'May 10, 2014'
count = -1;
for each in data0510['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0510
        if 'Today' in each:
            time = today0510
        data0510.set_value(count, 'registered', time)
data0510 = data0510.dropna()


#0517
data0517 = pd.read_csv('2014-05-17_userdat.csv', sep=",")
yesterday0517 = 'May 16, 1114'
today0517 = 'May 17, 2014'
count = -1;
for each in data0517['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0517
        if 'Today' in each:
            time = today0517
        data0517.set_value(count, 'registered', time)
data0517 = data0517.dropna()

#0524
data0524 = pd.read_csv('2014-05-24_userdat.csv', sep=",")
yesterday0524 = 'May 23, 1114'
today0524 = 'May 24, 2014'
count = -1;
for each in data0524['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0524
        if 'Today' in each:
            time = today0524
        data0524.set_value(count, 'registered', time)
data0524 = data0524.dropna()

#0529
data0529 = pd.read_csv('2014-05-29_userdat.csv', sep=",")
yesterday0529 = 'May 28, 1114'
today0529 = 'May 29, 2014'
count = -1;
for each in data0529['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0529
        if 'Today' in each:
            time = today0529
        data0529.set_value(count, 'registered', time)
data0529 = data0529.dropna()

df_new = pd.concat([data0503, data0510])
df_new = pd.concat([df_new, data0517])
df_new = pd.concat([df_new, data0524])
df_new = pd.concat([df_new, data0529])
df_5 = df_new.drop_duplicates(['username'], keep='last')

In [10]:
# June

#0604
data0604 = pd.read_csv('2014-06-04_userdat.csv', sep=",")
yesterday0604 = 'June 03, 1114'
today0604 = 'June 04, 2014'
count = -1;
for each in data0604['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0604
        if 'Today' in each:
            time = today0604
        data0604.set_value(count, 'registered', time)
data0604 = data0604.dropna()

#0607
data0607 = pd.read_csv('2014-06-07_userdat.csv', sep=",")
yesterday0607 = 'June 06, 1114'
today0607 = 'June 07, 2014'
count = -1;
for each in data0607['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0607
        if 'Today' in each:
            time = today0607
        data0607.set_value(count, 'registered', time)
data0607 = data0607.dropna()


#0611
data0611 = pd.read_csv('2014-06-11_userdat.csv', sep=",")
yesterday0611 = 'June 10, 1114'
today0611 = 'June 11, 2014'
count = -1;
for each in data0611['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0611
        if 'Today' in each:
            time = today0611
        data0611.set_value(count, 'registered', time)
data0611 = data0611.dropna()

#0619
data0619 = pd.read_csv('2014-06-19_userdat.csv', sep=",")
yesterday0619 = 'June 18, 1114'
today0619 = 'June 19, 2014'
count = -1;
for each in data0619['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0619
        if 'Today' in each:
            time = today0619
        data0619.set_value(count, 'registered', time)
data0619 = data0619.dropna()

#0624
data0624 = pd.read_csv('2014-06-24_userdat.csv', sep=",")
yesterday0624 = 'June 23, 1114'
today0624 = 'June 24, 2014'
count = -1;
for each in data0624['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0624
        if 'Today' in each:
            time = today0624
        data0624.set_value(count, 'registered', time)
data0624 = data0624.dropna()

#0630
data0630 = pd.read_csv('2014-06-30_userdat.csv', sep=",")
yesterday0630 = 'June 29, 1114'
today0630 = 'June 30, 2014'
count = -1;
for each in data0630['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0630
        if 'Today' in each:
            time = today0630
        data0630.set_value(count, 'registered', time)
data0630 = data0630.dropna()

df_new = pd.concat([data0604, data0607])
df_new = pd.concat([df_new, data0611])
df_new = pd.concat([df_new, data0619])
df_new = pd.concat([df_new, data0624])
df_new = pd.concat([df_new, data0630])
df_6 = df_new.drop_duplicates(['username'], keep='last')

In [11]:
# July

#0705
data0705 = pd.read_csv('2014-07-05_userdat.csv', sep=",")
yesterday0705 = 'July 04, 1114'
today0705 = 'July 05, 2014'
count = -1;
for each in data0705['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0705
        if 'Today' in each:
            time = today0705
        data0705.set_value(count, 'registered', time)
data0705 = data0705.dropna()

#0720
data0720 = pd.read_csv('2014-07-20_userdat.csv', sep=",")
yesterday0720 = 'July 19, 1114'
today0720 = 'July 20, 2014'
count = -1;
for each in data0720['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0720
        if 'Today' in each:
            time = today0720
        data0720.set_value(count, 'registered', time)
data0720 = data0720.dropna()


#0726
data0726 = pd.read_csv('2014-07-26_userdat.csv', sep=",")
yesterday0726 = 'July 25, 1114'
today0726 = 'July 26, 2014'
count = -1;
for each in data0726['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0726
        if 'Today' in each:
            time = today0726
        data0726.set_value(count, 'registered', time)
data0726 = data0726.dropna()

#0730
data0730 = pd.read_csv('2014-07-30_userdat.csv', sep=",")
yesterday0730 = 'July 29, 1114'
today0730 = 'July 30, 2014'
count = -1;
for each in data0730['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0730
        if 'Today' in each:
            time = today0730
        data0730.set_value(count, 'registered', time)
data0730 = data0730.dropna()

df_new = pd.concat([data0705, data0720])
df_new = pd.concat([df_new, data0726])
df_new = pd.concat([df_new, data0730])
df_7 = df_new.drop_duplicates(['username'], keep='last')

In [12]:
# August

#0803
data0803 = pd.read_csv('2014-08-03_userdat.csv', sep=",")
yesterday0803 = 'August 02, 1114'
today0803 = 'August 03, 2014'
count = -1;
for each in data0803['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0803
        if 'Today' in each:
            time = today0803
        data0803.set_value(count, 'registered', time)
data0803 = data0803.dropna()

#0809
data0809 = pd.read_csv('2014-08-09_userdat.csv', sep=",")
yesterday0809 = 'August 08, 1114'
today0809 = 'August 09, 2014'
count = -1;
for each in data0809['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0809
        if 'Today' in each:
            time = today0809
        data0809.set_value(count, 'registered', time)
data0809 = data0809.dropna()


#0814
data0814 = pd.read_csv('2014-08-14_userdat.csv', sep=",")
yesterday0814 = 'August 13, 1114'
today0814 = 'August 14, 2014'
count = -1;
for each in data0814['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0814
        if 'Today' in each:
            time = today0814
        data0814.set_value(count, 'registered', time)
data0814 = data0814.dropna()

#0822
data0822 = pd.read_csv('2014-08-22_userdat.csv', sep=",")
yesterday0822 = 'August 21, 1114'
today0822 = 'August 22, 2014'
count = -1;
for each in data0822['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0822
        if 'Today' in each:
            time = today0822
        data0822.set_value(count, 'registered', time)
data0822 = data0822.dropna()

#0827
data0827 = pd.read_csv('2014-08-27_userdat.csv', sep=",")
yesterday0827 = 'August 26, 1114'
today0827 = 'August 27, 2014'
count = -1;
for each in data0827['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0827
        if 'Today' in each:
            time = today0827
        data0827.set_value(count, 'registered', time)
data0827 = data0827.dropna()

#0831
data0831 = pd.read_csv('2014-08-31_userdat.csv', sep=",")
yesterday0831 = 'August 30, 1114'
today0831 = 'August 31, 2014'
count = -1;
for each in data0831['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0831
        if 'Today' in each:
            time = today0831
        data0831.set_value(count, 'registered', time)
data0831 = data0831.dropna()

df_new = pd.concat([data0803, data0809])
df_new = pd.concat([df_new, data0814])
df_new = pd.concat([df_new, data0822])
df_new = pd.concat([df_new, data0827])
df_new = pd.concat([df_new, data0831])
df_8 = df_new.drop_duplicates(['username'], keep='last')

In [13]:
# September

#0905
data0905 = pd.read_csv('2014-09-05_userdat.csv', sep=",")
yesterday0905 = 'September 04, 1114'
today0905 = 'September 05, 2014'
count = -1;
for each in data0905['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0905
        if 'Today' in each:
            time = today0905
        data0905.set_value(count, 'registered', time)
data0905 = data0905.dropna()

#0911
data0911 = pd.read_csv('2014-09-11_userdat.csv', sep=",")
yesterday0911 = 'September 10, 1114'
today0911 = 'September 11, 2014'
count = -1;
for each in data0911['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0911
        if 'Today' in each:
            time = today0911
        data0911.set_value(count, 'registered', time)
data0911 = data0911.dropna()


#0915
data0915 = pd.read_csv('2014-09-15_userdat.csv', sep=",")
yesterday0915 = 'September 14, 1114'
today0915 = 'September 15, 2014'
count = -1;
for each in data0915['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0915
        if 'Today' in each:
            time = today0915
        data0915.set_value(count, 'registered', time)
data0915 = data0915.dropna()

#0924
data0924 = pd.read_csv('2014-09-24_userdat.csv', sep=",")
yesterday0924 = 'September 23, 1114'
today0924 = 'September 24, 2014'
count = -1;
for each in data0924['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0924
        if 'Today' in each:
            time = today0924
        data0924.set_value(count, 'registered', time)
data0924 = data0924.dropna()

#0926
data0926 = pd.read_csv('2014-09-26_userdat.csv', sep=",")
yesterday0926 = 'September 25, 1114'
today0926 = 'September 26, 2014'
count = -1;
for each in data0926['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0926
        if 'Today' in each:
            time = today0926
        data0926.set_value(count, 'registered', time)
data0926 = data0926.dropna()

#0930
data0930 = pd.read_csv('2014-09-30_userdat.csv', sep=",")
yesterday0930 = 'September 29, 1114'
today0930 = 'September 30, 2014'
count = -1;
for each in data0930['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday0930
        if 'Today' in each:
            time = today0930
        data0930.set_value(count, 'registered', time)
data0930 = data0930.dropna()

df_new = pd.concat([data0905, data0911])
df_new = pd.concat([df_new, data0915])
df_new = pd.concat([df_new, data0924])
df_new = pd.concat([df_new, data0926])
df_new = pd.concat([df_new, data0930])
df_9 = df_new.drop_duplicates(['username'], keep='last')

In [14]:
# October

#1004
data1004 = pd.read_csv('2014-10-04_userdat.csv', sep=",")
yesterday1004 = 'October 03, 1114'
today1004 = 'October 04, 2014'
count = -1;
for each in data1004['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1004
        if 'Today' in each:
            time = today1004
        data1004.set_value(count, 'registered', time)
data1004 = data1004.dropna()

#1008
data1008 = pd.read_csv('2014-10-08_userdat.csv', sep=",")
yesterday1008 = 'October 07, 1114'
today1008 = 'October 08, 2014'
count = -1;
for each in data1008['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1008
        if 'Today' in each:
            time = today1008
        data1008.set_value(count, 'registered', time)
data1008 = data1008.dropna()


#1011
data1011 = pd.read_csv('2014-10-11_userdat.csv', sep=",")
yesterday1011 = 'October 10, 1114'
today1011 = 'October 11, 2014'
count = -1;
for each in data1011['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1011
        if 'Today' in each:
            time = today1011
        data1011.set_value(count, 'registered', time)
data1011 = data1011.dropna()

#1015
data1015 = pd.read_csv('2014-10-15_userdat.csv', sep=",")
yesterday1015 = 'October 14, 1114'
today1015 = 'October 15, 2014'
count = -1;
for each in data1015['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1015
        if 'Today' in each:
            time = today1015
        data1015.set_value(count, 'registered', time)
data1015 = data1015.dropna()

#1017
data1017 = pd.read_csv('2014-10-17_userdat.csv', sep=",")
yesterday1017 = 'October 16, 1114'
today1017 = 'October 17, 2014'
count = -1;
for each in data1017['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1017
        if 'Today' in each:
            time = today1017
        data1017.set_value(count, 'registered', time)
data1017 = data1017.dropna()

#1024
data1024 = pd.read_csv('2014-10-24_userdat.csv', sep=",")
yesterday1024 = 'October 23, 1114'
today1024 = 'October 24, 2014'
count = -1;
for each in data1024['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1024
        if 'Today' in each:
            time = today1024
        data1024.set_value(count, 'registered', time)
data1024 = data1024.dropna()

#1027
data1027 = pd.read_csv('2014-10-27_userdat.csv', sep=",")
yesterday1027 = 'October 26, 1114'
today1027 = 'October 27, 2014'
count = -1;
for each in data1027['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1027
        if 'Today' in each:
            time = today1027
        data1027.set_value(count, 'registered', time)
data1027 = data1027.dropna()

#1031
data1031 = pd.read_csv('2014-10-31_userdat.csv', sep=",")
yesterday1031 = 'October 30, 1114'
today1031 = 'October 31, 2014'
count = -1;
for each in data1031['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1031
        if 'Today' in each:
            time = today1031
        data1031.set_value(count, 'registered', time)
data1031 = data1031.dropna()

df_new = pd.concat([data1004, data1008])
df_new = pd.concat([df_new, data1011])
df_new = pd.concat([df_new, data1015])
df_new = pd.concat([df_new, data1017])
df_new = pd.concat([df_new, data1024])
df_new = pd.concat([df_new, data1027])
df_new = pd.concat([df_new, data1031])
df_10 = df_new.drop_duplicates(['username'], keep='last')

In [15]:
# November

#1101
data1101 = pd.read_csv('2014-11-01_userdat.csv', sep=",")
yesterday1101 = 'October 31, 1114'
today1101 = 'November 01, 2014'
count = -1;
for each in data1101['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1101
        if 'Today' in each:
            time = today1101
        data1101.set_value(count, 'registered', time)
data1101 = data1101.dropna()

#1104
data1104 = pd.read_csv('2014-11-04_userdat.csv', sep=",")
yesterday1104 = 'November 03, 1114'
today1104 = 'November 04, 2014'
count = -1;
for each in data1104['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1104
        if 'Today' in each:
            time = today1104
        data1104.set_value(count, 'registered', time)
data1104 = data1104.dropna()


#1106
data1106 = pd.read_csv('2014-11-06_userdat.csv', sep=",")
yesterday1106 = 'November 05, 1114'
today1106 = 'November 06, 2014'
count = -1;
for each in data1106['registered']:
    count = count + 1
    if pd.isnull(each) == False:
        time = each.rsplit(',',1)[0]
        if 'Yesterday' in each:
            time = yesterday1106
        if 'Today' in each:
            time = today1106
        data1106.set_value(count, 'registered', time)
data1106 = data1106.dropna()


df_new = pd.concat([data1101, data1104])
df_new = pd.concat([df_new, data1106])
df_11 = df_new.drop_duplicates(['username'], keep='last')

In [ ]:


In [113]:
df = pd.merge(df_1, df_2, on='username')

In [114]:
df = pd.merge(df, df_3, on='username')

In [115]:
df = pd.merge(df, df_4, on='username')

In [116]:
df = pd.merge(df, df_5, on='username')

In [117]:
df = pd.merge(df, df_6, on='username')

In [118]:
df = pd.merge(df, df_7, on='username')

In [119]:
df = pd.merge(df, df_8, on='username')

In [120]:
df = pd.merge(df, df_9, on='username')

In [121]:
df = pd.merge(df, df_10, on='username')

In [122]:
df = pd.merge(df, df_11, on='username')

In [123]:
df


Out[123]:
username position_x posts_x ppd_x up_x down_x registered_x position_y posts_y ppd_y ... ppd_y up_y down_y registered_y position posts ppd up down registered
0 gypsymoth Jr. Member 51.0 1.821 1.0 0.0 December 07, 2013 Jr. Member 51.0 0.654 ... 0.156 1.0 0.0 December 07, 2013 Jr. Member 51 0.154 1.0 0.0 December 07, 2013
1 Cassiano Newbie 13.0 0.419 0.0 0.0 December 07, 2013 Newbie 13.0 0.167 ... 0.040 0.0 0.0 December 07, 2013 Newbie 13 0.039 0.0 0.0 December 07, 2013
2 Comped Newbie 2.0 0.065 0.0 0.0 December 07, 2013 Newbie 2.0 0.026 ... 0.006 0.0 0.0 December 07, 2013 Newbie 2 0.006 0.0 0.0 December 07, 2013
3 cashmonay13 Newbie 1.0 0.037 0.0 0.0 December 07, 2013 Jr. Member 52.0 0.675 ... 0.160 0.0 0.0 December 07, 2013 Jr. Member 52 0.156 0.0 0.0 December 07, 2013
4 TheProfessionals Newbie 4.0 0.129 0.0 0.0 December 07, 2013 Jr. Member 60.0 0.779 ... 0.218 8.0 12.0 December 07, 2013 Jr. Member 71 0.214 8.0 12.0 December 07, 2013
5 mattttam132 Jr. Member 51.0 2.125 0.0 0.0 December 07, 2013 Jr. Member 51.0 0.680 ... 0.156 0.0 0.0 December 07, 2013 Jr. Member 51 0.154 0.0 0.0 December 07, 2013
6 fuckme Newbie 1.0 0.037 0.0 2.0 December 07, 2013 Newbie 1.0 0.013 ... 0.003 0.0 3.0 December 07, 2013 Newbie 1 0.003 0.0 3.0 December 07, 2013
7 tyrone Newbie 4.0 0.049 1.0 5.0 October 10, 2013 Newbie 32.0 0.239 ... 0.083 2.0 6.0 October 10, 2013 Newbie 32 0.082 2.0 6.0 October 10, 2013
8 BambooPanda Newbie 3.0 0.111 0.0 0.0 December 07, 2013 Newbie 3.0 0.039 ... 0.009 0.0 0.0 December 07, 2013 Newbie 3 0.009 0.0 0.0 December 07, 2013
9 pumpgalaxyy Newbie 0.0 0.000 0.0 0.0 December 07, 2013 Newbie 1.0 0.013 ... 0.003 0.0 0.0 December 07, 2013 Newbie 1 0.003 0.0 0.0 December 07, 2013
10 pampa11 Newbie 6.0 0.194 0.0 0.0 December 07, 2013 Newbie 6.0 0.078 ... 0.018 0.0 0.0 December 07, 2013 Newbie 6 0.018 0.0 0.0 December 07, 2013
11 xtrxitteh Newbie 0.0 0.000 0.0 0.0 December 07, 2013 Newbie 1.0 0.013 ... 0.003 0.0 0.0 December 07, 2013 Newbie 1 0.003 0.0 0.0 December 07, 2013
12 abrotherisjust Newbie 8.0 0.258 0.0 0.0 December 07, 2013 Newbie 34.0 0.442 ... 0.178 0.0 1.0 December 07, 2013 Jr. Member 58 0.175 0.0 1.0 December 07, 2013
13 user1020 Newbie 2.0 0.074 0.0 1.0 December 07, 2013 Newbie 2.0 0.027 ... 0.006 0.0 1.0 December 07, 2013 Newbie 2 0.006 0.0 1.0 December 07, 2013
14 TheNailSalon Newbie 10.0 0.370 1.0 0.0 December 07, 2013 Newbie 10.0 0.130 ... 0.031 1.0 1.0 December 07, 2013 Newbie 10 0.030 1.0 1.0 December 07, 2013
15 jm Jr. Member 87.0 2.806 7.0 1.0 December 07, 2013 Jr. Member 97.0 1.276 ... 0.302 10.0 2.0 December 07, 2013 Jr. Member 98 0.295 10.0 2.0 December 07, 2013
16 Counterintuitive Newbie 3.0 0.111 0.0 0.0 December 07, 2013 Newbie 3.0 0.039 ... 0.009 0.0 0.0 December 07, 2013 Newbie 3 0.009 0.0 0.0 December 07, 2013
17 jazzcatcf Newbie 7.0 0.318 0.0 0.0 December 07, 2013 Newbie 7.0 0.091 ... 0.021 0.0 0.0 December 07, 2013 Newbie 7 0.021 0.0 0.0 December 07, 2013
18 bitofanidiot Newbie 10.0 0.370 0.0 0.0 December 07, 2013 Newbie 10.0 0.130 ... 0.031 0.0 0.0 December 07, 2013 Newbie 10 0.030 0.0 0.0 December 07, 2013
19 oCDik6kbY49GCL5 Newbie 1.0 0.037 0.0 0.0 December 07, 2013 Newbie 1.0 0.013 ... 0.003 0.0 0.0 December 07, 2013 Newbie 1 0.003 0.0 0.0 December 07, 2013
20 AlterEgo Newbie 1.0 0.012 0.0 0.0 October 10, 2013 Newbie 1.0 0.007 ... 0.003 0.0 0.0 October 10, 2013 Newbie 1 0.003 0.0 0.0 October 10, 2013
21 treeman Newbie 1.0 0.033 0.0 0.0 December 07, 2013 Newbie 12.0 0.154 ... 0.037 0.0 0.0 December 07, 2013 Newbie 12 0.036 0.0 0.0 December 07, 2013
22 someone888 Newbie 18.0 0.667 1.0 0.0 December 07, 2013 Newbie 18.0 0.234 ... 0.068 1.0 0.0 December 07, 2013 Newbie 22 0.066 1.0 0.0 December 07, 2013
23 Hanley Newbie 7.0 0.259 0.0 0.0 December 07, 2013 Newbie 7.0 0.091 ... 0.021 0.0 0.0 December 07, 2013 Newbie 7 0.021 0.0 0.0 December 07, 2013
24 FatStra Newbie 25.0 0.833 3.0 0.0 December 07, 2013 Newbie 25.0 0.325 ... 0.077 3.0 0.0 December 07, 2013 Newbie 25 0.075 3.0 0.0 December 07, 2013
25 Super168 Newbie 0.0 0.000 0.0 0.0 December 07, 2013 Jr. Member 54.0 0.701 ... 0.179 0.0 1.0 December 07, 2013 Vendor 58 0.175 0.0 1.0 December 07, 2013
26 Reddogg Newbie 11.0 0.478 0.0 1.0 December 07, 2013 Newbie 11.0 0.143 ... 0.235 13.0 3.0 December 07, 2013 Jr. Member 76 0.229 13.0 3.0 December 07, 2013
27 Save0nDrugs Newbie 2.0 0.067 0.0 0.0 December 08, 2013 Newbie 2.0 0.026 ... 0.220 13.0 2.0 December 08, 2013 Vendor 72 0.217 13.0 2.0 December 08, 2013
28 Thehorseofcourse Newbie 11.0 0.407 0.0 0.0 December 08, 2013 Newbie 11.0 0.143 ... 0.034 0.0 1.0 December 08, 2013 Newbie 11 0.033 0.0 1.0 December 08, 2013
29 therealericcartmanSR Newbie 39.0 1.444 1.0 3.0 December 08, 2013 Newbie 39.0 0.506 ... 0.117 1.0 3.0 December 08, 2013 Newbie 38 0.114 1.0 3.0 December 08, 2013
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
6032 wolfhat110 Newbie 30.0 0.566 4.0 0.0 December 04, 2013 Newbie 30.0 0.375 ... 0.086 5.0 0.0 December 04, 2013 Newbie 28 0.084 5.0 0.0 December 04, 2013
6033 Nunya Bizness Newbie 2.0 1.000 0.0 2.0 January 24, 2014 Newbie 6.0 0.207 ... 0.022 2.0 2.0 January 24, 2014 Newbie 6 0.021 2.0 2.0 January 24, 2014
6034 frankie4toes Newbie 9.0 2.250 0.0 0.0 January 22, 2014 Newbie 12.0 0.387 ... 0.201 2.0 1.0 January 22, 2014 Jr. Member 56 0.196 2.0 1.0 January 22, 2014
6035 byebyesheep1 Newbie 21.0 0.404 1.0 9.0 December 05, 2013 Newbie 21.0 0.266 ... 0.064 1.0 9.0 December 05, 2013 Newbie 21 0.063 1.0 9.0 December 05, 2013
6036 GreenGrandpa Vendor 3.0 0.028 0.0 0.0 October 09, 2013 Vendor 3.0 0.022 ... 0.008 0.0 0.0 October 09, 2013 Newbie 3 0.008 0.0 0.0 October 09, 2013
6037 HimalayanBlues Vendor 78.0 1.164 12.0 1.0 November 21, 2013 Vendor 95.0 1.033 ... 0.376 13.0 3.0 November 21, 2013 Vendor 128 0.367 13.0 3.0 November 21, 2013
6038 SantanaEscobar Jr. Member 92.0 4.842 20.0 3.0 January 08, 2014 Jr. Member 91.0 1.978 ... 0.306 20.0 7.0 January 08, 2014 Jr. Member 90 0.298 20.0 7.0 January 08, 2014
6039 fuNguyZ Newbie 7.0 0.103 1.0 0.0 November 19, 2013 Newbie 7.0 0.074 ... 0.020 1.0 0.0 November 19, 2013 Newbie 7 0.020 1.0 0.0 November 19, 2013
6040 wakemeup Newbie 18.0 0.162 1.0 1.0 October 08, 2013 Newbie 14.0 0.102 ... 0.055 1.0 1.0 October 08, 2013 Newbie 21 0.054 1.0 1.0 October 08, 2013
6041 MisterMan Jr. Member 51.0 1.889 0.0 0.0 December 31, 2013 Jr. Member 51.0 0.944 ... 0.169 0.0 0.0 December 31, 2013 Jr. Member 51 0.166 0.0 0.0 December 31, 2013
6042 snooze Jr. Member 63.0 0.578 32.0 10.0 October 10, 2013 Jr. Member 63.0 0.467 ... 0.141 33.0 10.0 October 10, 2013 Jr. Member 54 0.139 33.0 10.0 October 10, 2013
6043 BrownBagSwag Newbie 1.0 0.011 0.0 0.0 October 31, 2013 Newbie 1.0 0.009 ... 0.003 0.0 0.0 October 31, 2013 Newbie 1 0.003 0.0 0.0 October 31, 2013
6044 Moonmanisback Newbie 48.0 0.696 0.0 2.0 November 19, 2013 Newbie 48.0 0.505 ... 0.135 1.0 2.0 November 19, 2013 Newbie 46 0.131 1.0 2.0 November 19, 2013
6045 joenamath Jr. Member 64.0 6.400 0.0 3.0 January 16, 2014 Full Member 106.0 2.944 ... 3.417 323.0 166.0 January 16, 2014 Hero Member 975 3.339 330.0 170.0 January 16, 2014
6046 TheJawBone Newbie 45.0 0.634 7.0 2.0 November 17, 2013 Jr. Member 73.0 0.753 ... 0.299 19.0 4.0 November 17, 2013 Full Member 103 0.292 19.0 4.0 November 17, 2013
6047 BB22 Jr. Member 51.0 2.217 0.0 0.0 January 03, 2014 Jr. Member 53.0 1.128 ... 0.182 0.0 0.0 January 03, 2014 Jr. Member 54 0.176 0.0 0.0 January 03, 2014
6048 heepdeep Newbie 37.0 0.860 2.0 0.0 December 14, 2013 Newbie 36.0 0.514 ... 0.113 3.0 0.0 December 14, 2013 Newbie 36 0.111 3.0 0.0 December 14, 2013
6049 protoalgae Newbie 11.0 1.222 1.0 0.0 January 18, 2014 Jr. Member 50.0 1.429 ... 0.174 1.0 0.0 January 18, 2014 Newbie 49 0.168 1.0 0.0 January 18, 2014
6050 bingoplayer Newbie 15.0 0.185 0.0 0.0 November 06, 2013 Newbie 15.0 0.139 ... 0.042 0.0 0.0 November 06, 2013 Newbie 15 0.041 0.0 0.0 November 06, 2013
6051 theabsolutefinest Vendor 20.0 0.189 2.0 5.0 October 13, 2013 Vendor 20.0 0.152 ... 0.053 2.0 5.0 October 13, 2013 Newbie 20 0.052 2.0 5.0 October 13, 2013
6052 danjango1 Jr. Member 61.0 0.629 3.0 2.0 October 22, 2013 Jr. Member 62.0 0.504 ... 0.195 5.0 2.0 October 22, 2013 Jr. Member 72 0.190 5.0 2.0 October 22, 2013
6053 4739254859352548 Newbie 1.0 0.016 1.0 2.0 November 26, 2013 Newbie 1.0 0.011 ... 0.003 1.0 2.0 November 26, 2013 Newbie 1 0.003 1.0 2.0 November 26, 2013
6054 19091909 Newbie 1.0 0.014 0.0 0.0 November 18, 2013 Newbie 1.0 0.010 ... 0.003 0.0 0.0 November 18, 2013 Newbie 1 0.003 0.0 0.0 November 18, 2013
6055 MoonBaseOne Jr. Member 71.0 11.833 0.0 0.0 January 21, 2014 Jr. Member 71.0 2.152 ... 0.254 0.0 0.0 January 21, 2014 Jr. Member 71 0.247 0.0 0.0 January 21, 2014
6056 saturnair Newbie 1.0 0.015 0.0 0.0 November 22, 2013 Newbie 1.0 0.011 ... 0.003 0.0 0.0 November 22, 2013 Newbie 1 0.003 0.0 0.0 November 22, 2013
6057 theanchor Vendor 8.0 0.073 3.0 1.0 October 09, 2013 Vendor 8.0 0.059 ... 0.021 3.0 1.0 October 09, 2013 Vendor 8 0.020 3.0 1.0 October 09, 2013
6058 waterdragon Jr. Member 55.0 5.000 2.0 0.0 January 15, 2014 Jr. Member 57.0 1.500 ... 0.236 5.0 0.0 January 15, 2014 Jr. Member 67 0.229 5.0 0.0 January 15, 2014
6059 myoldschool Newbie 1.0 0.009 0.0 0.0 October 09, 2013 Newbie 1.0 0.007 ... 0.003 0.0 0.0 October 09, 2013 Newbie 1 0.003 0.0 0.0 October 09, 2013
6060 ApeFootTall Jr. Member 50.0 0.847 1.0 1.0 November 27, 2013 Jr. Member 52.0 0.598 ... 0.155 1.0 1.0 November 27, 2013 Jr. Member 52 0.153 1.0 1.0 November 27, 2013
6061 garconSR2 Newbie 10.0 1.429 3.0 0.0 January 20, 2014 Jr. Member 58.0 1.758 ... 0.239 3.0 1.0 January 20, 2014 Jr. Member 67 0.232 3.0 1.0 January 20, 2014

6062 rows × 67 columns


In [124]:
df.columns = ['username', 'pos1', 'posts1', 'ppd1', 'up1', 'down1',
       'registered1', 'pos2', 'posts2', 'ppd2', 'up2', 'down2',
       'registered2', 'pos3', 'posts3', 'ppd3', 'up3', 'down3',
       'registered3', 'pos4', 'posts4', 'ppd4', 'up4', 'down4',
       'registered4', 'pos5', 'posts5', 'ppd5', 'up5', 'down5',
       'registered5', 'pos6', 'posts6', 'ppd6', 'up6', 'down6',
       'registered6', 'pos7', 'posts7', 'ppd7', 'up7', 'down7',
       'registered7', 'pos8', 'posts8', 'ppd8', 'up8', 'down8',
       'registered8', 'pos9', 'posts9', 'ppd9', 'up9', 'down9',
       'registered9', 'pos10', 'posts10', 'ppd10', 'up10', 'down10',
       'registered10', 'pos11', 'posts11', 'ppd11', 'up11', 'down11',
       'registered11']

In [ ]:


In [125]:
data = {'username': df['username'],
        'position': df['pos1'],
        'posts': df['posts1'],
        'ppd': df['ppd1'],
        'up': df['up1'],
        'down': df['down1'],
        'registered': df['registered1']}
merge1 = pd.DataFrame(data)
merge1 = merge1[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]
merge1


Out[125]:
username position posts ppd up down registered
0 gypsymoth Jr. Member 51.0 1.821 1.0 0.0 December 07, 2013
1 Cassiano Newbie 13.0 0.419 0.0 0.0 December 07, 2013
2 Comped Newbie 2.0 0.065 0.0 0.0 December 07, 2013
3 cashmonay13 Newbie 1.0 0.037 0.0 0.0 December 07, 2013
4 TheProfessionals Newbie 4.0 0.129 0.0 0.0 December 07, 2013
5 mattttam132 Jr. Member 51.0 2.125 0.0 0.0 December 07, 2013
6 fuckme Newbie 1.0 0.037 0.0 2.0 December 07, 2013
7 tyrone Newbie 4.0 0.049 1.0 5.0 October 10, 2013
8 BambooPanda Newbie 3.0 0.111 0.0 0.0 December 07, 2013
9 pumpgalaxyy Newbie 0.0 0.000 0.0 0.0 December 07, 2013
10 pampa11 Newbie 6.0 0.194 0.0 0.0 December 07, 2013
11 xtrxitteh Newbie 0.0 0.000 0.0 0.0 December 07, 2013
12 abrotherisjust Newbie 8.0 0.258 0.0 0.0 December 07, 2013
13 user1020 Newbie 2.0 0.074 0.0 1.0 December 07, 2013
14 TheNailSalon Newbie 10.0 0.370 1.0 0.0 December 07, 2013
15 jm Jr. Member 87.0 2.806 7.0 1.0 December 07, 2013
16 Counterintuitive Newbie 3.0 0.111 0.0 0.0 December 07, 2013
17 jazzcatcf Newbie 7.0 0.318 0.0 0.0 December 07, 2013
18 bitofanidiot Newbie 10.0 0.370 0.0 0.0 December 07, 2013
19 oCDik6kbY49GCL5 Newbie 1.0 0.037 0.0 0.0 December 07, 2013
20 AlterEgo Newbie 1.0 0.012 0.0 0.0 October 10, 2013
21 treeman Newbie 1.0 0.033 0.0 0.0 December 07, 2013
22 someone888 Newbie 18.0 0.667 1.0 0.0 December 07, 2013
23 Hanley Newbie 7.0 0.259 0.0 0.0 December 07, 2013
24 FatStra Newbie 25.0 0.833 3.0 0.0 December 07, 2013
25 Super168 Newbie 0.0 0.000 0.0 0.0 December 07, 2013
26 Reddogg Newbie 11.0 0.478 0.0 1.0 December 07, 2013
27 Save0nDrugs Newbie 2.0 0.067 0.0 0.0 December 08, 2013
28 Thehorseofcourse Newbie 11.0 0.407 0.0 0.0 December 08, 2013
29 therealericcartmanSR Newbie 39.0 1.444 1.0 3.0 December 08, 2013
... ... ... ... ... ... ... ...
6032 wolfhat110 Newbie 30.0 0.566 4.0 0.0 December 04, 2013
6033 Nunya Bizness Newbie 2.0 1.000 0.0 2.0 January 24, 2014
6034 frankie4toes Newbie 9.0 2.250 0.0 0.0 January 22, 2014
6035 byebyesheep1 Newbie 21.0 0.404 1.0 9.0 December 05, 2013
6036 GreenGrandpa Vendor 3.0 0.028 0.0 0.0 October 09, 2013
6037 HimalayanBlues Vendor 78.0 1.164 12.0 1.0 November 21, 2013
6038 SantanaEscobar Jr. Member 92.0 4.842 20.0 3.0 January 08, 2014
6039 fuNguyZ Newbie 7.0 0.103 1.0 0.0 November 19, 2013
6040 wakemeup Newbie 18.0 0.162 1.0 1.0 October 08, 2013
6041 MisterMan Jr. Member 51.0 1.889 0.0 0.0 December 31, 2013
6042 snooze Jr. Member 63.0 0.578 32.0 10.0 October 10, 2013
6043 BrownBagSwag Newbie 1.0 0.011 0.0 0.0 October 31, 2013
6044 Moonmanisback Newbie 48.0 0.696 0.0 2.0 November 19, 2013
6045 joenamath Jr. Member 64.0 6.400 0.0 3.0 January 16, 2014
6046 TheJawBone Newbie 45.0 0.634 7.0 2.0 November 17, 2013
6047 BB22 Jr. Member 51.0 2.217 0.0 0.0 January 03, 2014
6048 heepdeep Newbie 37.0 0.860 2.0 0.0 December 14, 2013
6049 protoalgae Newbie 11.0 1.222 1.0 0.0 January 18, 2014
6050 bingoplayer Newbie 15.0 0.185 0.0 0.0 November 06, 2013
6051 theabsolutefinest Vendor 20.0 0.189 2.0 5.0 October 13, 2013
6052 danjango1 Jr. Member 61.0 0.629 3.0 2.0 October 22, 2013
6053 4739254859352548 Newbie 1.0 0.016 1.0 2.0 November 26, 2013
6054 19091909 Newbie 1.0 0.014 0.0 0.0 November 18, 2013
6055 MoonBaseOne Jr. Member 71.0 11.833 0.0 0.0 January 21, 2014
6056 saturnair Newbie 1.0 0.015 0.0 0.0 November 22, 2013
6057 theanchor Vendor 8.0 0.073 3.0 1.0 October 09, 2013
6058 waterdragon Jr. Member 55.0 5.000 2.0 0.0 January 15, 2014
6059 myoldschool Newbie 1.0 0.009 0.0 0.0 October 09, 2013
6060 ApeFootTall Jr. Member 50.0 0.847 1.0 1.0 November 27, 2013
6061 garconSR2 Newbie 10.0 1.429 3.0 0.0 January 20, 2014

6062 rows × 7 columns


In [126]:
data = {'username': df['username'],
        'position': df['pos2'],
        'posts': df['posts2'],
        'ppd': df['ppd2'],
        'up': df['up2'],
        'down': df['down2'],
        'registered': df['registered2']}
merge2 = pd.DataFrame(data)
merge2 = merge2[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [127]:
data = {'username': df['username'],
        'position': df['pos3'],
        'posts': df['posts3'],
        'ppd': df['ppd3'],
        'up': df['up3'],
        'down': df['down3'],
        'registered': df['registered3']}
merge3 = pd.DataFrame(data)
merge3 = merge3[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [128]:
data = {'username': df['username'],
        'position': df['pos4'],
        'posts': df['posts4'],
        'ppd': df['ppd4'],
        'up': df['up4'],
        'down': df['down4'],
        'registered': df['registered4']}
merge4 = pd.DataFrame(data)
merge4 = merge4[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [129]:
data = {'username': df['username'],
        'position': df['pos5'],
        'posts': df['posts5'],
        'ppd': df['ppd5'],
        'up': df['up5'],
        'down': df['down5'],
        'registered': df['registered5']}
merge5 = pd.DataFrame(data)
merge5 = merge5[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [130]:
data = {'username': df['username'],
        'position': df['pos6'],
        'posts': df['posts6'],
        'ppd': df['ppd6'],
        'up': df['up6'],
        'down': df['down6'],
        'registered': df['registered6']}
merge6 = pd.DataFrame(data)
merge6 = merge6[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [131]:
data = {'username': df['username'],
        'position': df['pos7'],
        'posts': df['posts7'],
        'ppd': df['ppd7'],
        'up': df['up7'],
        'down': df['down7'],
        'registered': df['registered7']}
merge7 = pd.DataFrame(data)
merge7 = merge7[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [132]:
data = {'username': df['username'],
        'position': df['pos8'],
        'posts': df['posts8'],
        'ppd': df['ppd8'],
        'up': df['up8'],
        'down': df['down8'],
        'registered': df['registered8']}
merge8 = pd.DataFrame(data)
merge8 = merge8[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [133]:
data = {'username': df['username'],
        'position': df['pos9'],
        'posts': df['posts9'],
        'ppd': df['ppd9'],
        'up': df['up9'],
        'down': df['down9'],
        'registered': df['registered9']}
merge9 = pd.DataFrame(data)
merge9 = merge9[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [134]:
data = {'username': df['username'],
        'position': df['pos10'],
        'posts': df['posts10'],
        'ppd': df['ppd10'],
        'up': df['up10'],
        'down': df['down10'],
        'registered': df['registered10']}
merge10 = pd.DataFrame(data)
merge10 = merge10[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]

In [135]:
data = {'username': df['username'],
        'position': df['pos11'],
        'posts': df['posts11'],
        'ppd': df['ppd11'],
        'up': df['up11'],
        'down': df['down11'],
        'registered': df['registered11']}
merge11 = pd.DataFrame(data)
merge11 = merge11[['username', 'position', 'posts', 'ppd', 'up', 'down', 'registered']]
merge11


Out[135]:
username position posts ppd up down registered
0 gypsymoth Jr. Member 51 0.154 1.0 0.0 December 07, 2013
1 Cassiano Newbie 13 0.039 0.0 0.0 December 07, 2013
2 Comped Newbie 2 0.006 0.0 0.0 December 07, 2013
3 cashmonay13 Jr. Member 52 0.156 0.0 0.0 December 07, 2013
4 TheProfessionals Jr. Member 71 0.214 8.0 12.0 December 07, 2013
5 mattttam132 Jr. Member 51 0.154 0.0 0.0 December 07, 2013
6 fuckme Newbie 1 0.003 0.0 3.0 December 07, 2013
7 tyrone Newbie 32 0.082 2.0 6.0 October 10, 2013
8 BambooPanda Newbie 3 0.009 0.0 0.0 December 07, 2013
9 pumpgalaxyy Newbie 1 0.003 0.0 0.0 December 07, 2013
10 pampa11 Newbie 6 0.018 0.0 0.0 December 07, 2013
11 xtrxitteh Newbie 1 0.003 0.0 0.0 December 07, 2013
12 abrotherisjust Jr. Member 58 0.175 0.0 1.0 December 07, 2013
13 user1020 Newbie 2 0.006 0.0 1.0 December 07, 2013
14 TheNailSalon Newbie 10 0.030 1.0 1.0 December 07, 2013
15 jm Jr. Member 98 0.295 10.0 2.0 December 07, 2013
16 Counterintuitive Newbie 3 0.009 0.0 0.0 December 07, 2013
17 jazzcatcf Newbie 7 0.021 0.0 0.0 December 07, 2013
18 bitofanidiot Newbie 10 0.030 0.0 0.0 December 07, 2013
19 oCDik6kbY49GCL5 Newbie 1 0.003 0.0 0.0 December 07, 2013
20 AlterEgo Newbie 1 0.003 0.0 0.0 October 10, 2013
21 treeman Newbie 12 0.036 0.0 0.0 December 07, 2013
22 someone888 Newbie 22 0.066 1.0 0.0 December 07, 2013
23 Hanley Newbie 7 0.021 0.0 0.0 December 07, 2013
24 FatStra Newbie 25 0.075 3.0 0.0 December 07, 2013
25 Super168 Vendor 58 0.175 0.0 1.0 December 07, 2013
26 Reddogg Jr. Member 76 0.229 13.0 3.0 December 07, 2013
27 Save0nDrugs Vendor 72 0.217 13.0 2.0 December 08, 2013
28 Thehorseofcourse Newbie 11 0.033 0.0 1.0 December 08, 2013
29 therealericcartmanSR Newbie 38 0.114 1.0 3.0 December 08, 2013
... ... ... ... ... ... ... ...
6032 wolfhat110 Newbie 28 0.084 5.0 0.0 December 04, 2013
6033 Nunya Bizness Newbie 6 0.021 2.0 2.0 January 24, 2014
6034 frankie4toes Jr. Member 56 0.196 2.0 1.0 January 22, 2014
6035 byebyesheep1 Newbie 21 0.063 1.0 9.0 December 05, 2013
6036 GreenGrandpa Newbie 3 0.008 0.0 0.0 October 09, 2013
6037 HimalayanBlues Vendor 128 0.367 13.0 3.0 November 21, 2013
6038 SantanaEscobar Jr. Member 90 0.298 20.0 7.0 January 08, 2014
6039 fuNguyZ Newbie 7 0.020 1.0 0.0 November 19, 2013
6040 wakemeup Newbie 21 0.054 1.0 1.0 October 08, 2013
6041 MisterMan Jr. Member 51 0.166 0.0 0.0 December 31, 2013
6042 snooze Jr. Member 54 0.139 33.0 10.0 October 10, 2013
6043 BrownBagSwag Newbie 1 0.003 0.0 0.0 October 31, 2013
6044 Moonmanisback Newbie 46 0.131 1.0 2.0 November 19, 2013
6045 joenamath Hero Member 975 3.339 330.0 170.0 January 16, 2014
6046 TheJawBone Full Member 103 0.292 19.0 4.0 November 17, 2013
6047 BB22 Jr. Member 54 0.176 0.0 0.0 January 03, 2014
6048 heepdeep Newbie 36 0.111 3.0 0.0 December 14, 2013
6049 protoalgae Newbie 49 0.168 1.0 0.0 January 18, 2014
6050 bingoplayer Newbie 15 0.041 0.0 0.0 November 06, 2013
6051 theabsolutefinest Newbie 20 0.052 2.0 5.0 October 13, 2013
6052 danjango1 Jr. Member 72 0.190 5.0 2.0 October 22, 2013
6053 4739254859352548 Newbie 1 0.003 1.0 2.0 November 26, 2013
6054 19091909 Newbie 1 0.003 0.0 0.0 November 18, 2013
6055 MoonBaseOne Jr. Member 71 0.247 0.0 0.0 January 21, 2014
6056 saturnair Newbie 1 0.003 0.0 0.0 November 22, 2013
6057 theanchor Vendor 8 0.020 3.0 1.0 October 09, 2013
6058 waterdragon Jr. Member 67 0.229 5.0 0.0 January 15, 2014
6059 myoldschool Newbie 1 0.003 0.0 0.0 October 09, 2013
6060 ApeFootTall Jr. Member 52 0.153 1.0 1.0 November 27, 2013
6061 garconSR2 Jr. Member 67 0.232 3.0 1.0 January 20, 2014

6062 rows × 7 columns


In [136]:
merge11['score'] = abs(merge11['up'] - merge11['down'])
merge11


Out[136]:
username position posts ppd up down registered score
0 gypsymoth Jr. Member 51 0.154 1.0 0.0 December 07, 2013 1.0
1 Cassiano Newbie 13 0.039 0.0 0.0 December 07, 2013 0.0
2 Comped Newbie 2 0.006 0.0 0.0 December 07, 2013 0.0
3 cashmonay13 Jr. Member 52 0.156 0.0 0.0 December 07, 2013 0.0
4 TheProfessionals Jr. Member 71 0.214 8.0 12.0 December 07, 2013 4.0
5 mattttam132 Jr. Member 51 0.154 0.0 0.0 December 07, 2013 0.0
6 fuckme Newbie 1 0.003 0.0 3.0 December 07, 2013 3.0
7 tyrone Newbie 32 0.082 2.0 6.0 October 10, 2013 4.0
8 BambooPanda Newbie 3 0.009 0.0 0.0 December 07, 2013 0.0
9 pumpgalaxyy Newbie 1 0.003 0.0 0.0 December 07, 2013 0.0
10 pampa11 Newbie 6 0.018 0.0 0.0 December 07, 2013 0.0
11 xtrxitteh Newbie 1 0.003 0.0 0.0 December 07, 2013 0.0
12 abrotherisjust Jr. Member 58 0.175 0.0 1.0 December 07, 2013 1.0
13 user1020 Newbie 2 0.006 0.0 1.0 December 07, 2013 1.0
14 TheNailSalon Newbie 10 0.030 1.0 1.0 December 07, 2013 0.0
15 jm Jr. Member 98 0.295 10.0 2.0 December 07, 2013 8.0
16 Counterintuitive Newbie 3 0.009 0.0 0.0 December 07, 2013 0.0
17 jazzcatcf Newbie 7 0.021 0.0 0.0 December 07, 2013 0.0
18 bitofanidiot Newbie 10 0.030 0.0 0.0 December 07, 2013 0.0
19 oCDik6kbY49GCL5 Newbie 1 0.003 0.0 0.0 December 07, 2013 0.0
20 AlterEgo Newbie 1 0.003 0.0 0.0 October 10, 2013 0.0
21 treeman Newbie 12 0.036 0.0 0.0 December 07, 2013 0.0
22 someone888 Newbie 22 0.066 1.0 0.0 December 07, 2013 1.0
23 Hanley Newbie 7 0.021 0.0 0.0 December 07, 2013 0.0
24 FatStra Newbie 25 0.075 3.0 0.0 December 07, 2013 3.0
25 Super168 Vendor 58 0.175 0.0 1.0 December 07, 2013 1.0
26 Reddogg Jr. Member 76 0.229 13.0 3.0 December 07, 2013 10.0
27 Save0nDrugs Vendor 72 0.217 13.0 2.0 December 08, 2013 11.0
28 Thehorseofcourse Newbie 11 0.033 0.0 1.0 December 08, 2013 1.0
29 therealericcartmanSR Newbie 38 0.114 1.0 3.0 December 08, 2013 2.0
... ... ... ... ... ... ... ... ...
6032 wolfhat110 Newbie 28 0.084 5.0 0.0 December 04, 2013 5.0
6033 Nunya Bizness Newbie 6 0.021 2.0 2.0 January 24, 2014 0.0
6034 frankie4toes Jr. Member 56 0.196 2.0 1.0 January 22, 2014 1.0
6035 byebyesheep1 Newbie 21 0.063 1.0 9.0 December 05, 2013 8.0
6036 GreenGrandpa Newbie 3 0.008 0.0 0.0 October 09, 2013 0.0
6037 HimalayanBlues Vendor 128 0.367 13.0 3.0 November 21, 2013 10.0
6038 SantanaEscobar Jr. Member 90 0.298 20.0 7.0 January 08, 2014 13.0
6039 fuNguyZ Newbie 7 0.020 1.0 0.0 November 19, 2013 1.0
6040 wakemeup Newbie 21 0.054 1.0 1.0 October 08, 2013 0.0
6041 MisterMan Jr. Member 51 0.166 0.0 0.0 December 31, 2013 0.0
6042 snooze Jr. Member 54 0.139 33.0 10.0 October 10, 2013 23.0
6043 BrownBagSwag Newbie 1 0.003 0.0 0.0 October 31, 2013 0.0
6044 Moonmanisback Newbie 46 0.131 1.0 2.0 November 19, 2013 1.0
6045 joenamath Hero Member 975 3.339 330.0 170.0 January 16, 2014 160.0
6046 TheJawBone Full Member 103 0.292 19.0 4.0 November 17, 2013 15.0
6047 BB22 Jr. Member 54 0.176 0.0 0.0 January 03, 2014 0.0
6048 heepdeep Newbie 36 0.111 3.0 0.0 December 14, 2013 3.0
6049 protoalgae Newbie 49 0.168 1.0 0.0 January 18, 2014 1.0
6050 bingoplayer Newbie 15 0.041 0.0 0.0 November 06, 2013 0.0
6051 theabsolutefinest Newbie 20 0.052 2.0 5.0 October 13, 2013 3.0
6052 danjango1 Jr. Member 72 0.190 5.0 2.0 October 22, 2013 3.0
6053 4739254859352548 Newbie 1 0.003 1.0 2.0 November 26, 2013 1.0
6054 19091909 Newbie 1 0.003 0.0 0.0 November 18, 2013 0.0
6055 MoonBaseOne Jr. Member 71 0.247 0.0 0.0 January 21, 2014 0.0
6056 saturnair Newbie 1 0.003 0.0 0.0 November 22, 2013 0.0
6057 theanchor Vendor 8 0.020 3.0 1.0 October 09, 2013 2.0
6058 waterdragon Jr. Member 67 0.229 5.0 0.0 January 15, 2014 5.0
6059 myoldschool Newbie 1 0.003 0.0 0.0 October 09, 2013 0.0
6060 ApeFootTall Jr. Member 52 0.153 1.0 1.0 November 27, 2013 0.0
6061 garconSR2 Jr. Member 67 0.232 3.0 1.0 January 20, 2014 2.0

6062 rows × 8 columns


In [137]:
count = -1
for each in merge11['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge11.set_value(count, 'score', order)

In [138]:
merge11_sort = merge11.sort_values(by='score', ascending=0)

In [139]:
rank = range(1,6062)
merge11_sort = merge11_sort[merge11_sort.username != 'DoctorClu']
merge11_sort['rank'] = rank
#merge11_sort

In [140]:
top20 = merge11_sort[:20]['username'].values


#merge11_sort[merge11_sort.username == top20[0]]['rank']

In [141]:
merge10['score'] = abs(merge10['up'] - merge10['down'])

count = -1
for each in merge10['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge10.set_value(count, 'score', order)

merge10_sort = merge10.sort_values(by='score', ascending=0)
merge10_sort = merge10_sort[merge10_sort.username != 'DoctorClu']
merge10_sort['rank'] = rank

In [142]:
merge10_sort[:50]


Out[142]:
username position posts ppd up down registered score rank
3664 Defcon Administrator 781 2.244 803.0 136.0 November 13, 2013 2.824126 1
4351 This Is Serious Mum Jr. Member 69 0.186 659.0 55.0 October 21, 2013 2.781037 2
2745 Hiniguel Hero Member 1778 4.679 683.0 153.0 October 12, 2013 2.724276 3
4742 Jack N Hoff Vendor 2083 5.525 591.0 132.0 October 14, 2013 2.661813 4
4675 The Jigsaw Puzzle Hero Member 2277 6.221 618.0 186.0 October 26, 2013 2.635484 5
5411 mary666 Hero Member 2374 6.198 504.0 92.0 October 09, 2013 2.614897 6
1837 murderface2012 Hero Member 1604 4.676 614.0 228.0 November 17, 2013 2.586587 7
2789 Tang Newbie Guide 4615 13.735 396.0 64.0 November 25, 2013 2.521138 8
3693 Alfred Hero Member 1030 2.689 339.0 31.0 October 09, 2013 2.488551 9
3978 shashimartell Sr. Member 442 1.169 327.0 37.0 October 14, 2013 2.462398 10
2979 ProEvo Hero Member 1218 3.172 308.0 37.0 October 08, 2013 2.432969 11
2847 calcium345 Hero Member 1644 4.850 302.0 49.0 November 21, 2013 2.403121 12
3628 VanillaRoyale Vendor 527 1.523 381.0 129.0 November 15, 2013 2.401401 13
3455 twatWaffle Hero Member 1291 3.371 298.0 71.0 October 08, 2013 2.356026 14
4812 Yoda Hero Member 1452 3.791 260.0 34.0 October 09, 2013 2.354108 15
5300 bodnostrokulum Sr. Member 378 1.011 274.0 50.0 October 18, 2013 2.350248 16
5038 The President Hero Member 557 1.451 255.0 31.0 October 08, 2013 2.350248 17
5588 BoxofShapes Hero Member 892 2.335 244.0 22.0 October 09, 2013 2.346353 18
3815 Jolly Roger Hero Member 551 1.868 257.0 38.0 January 05, 2014 2.340444 19
4041 chemicals_spain Vendor 1851 5.695 317.0 105.0 December 05, 2013 2.326336 20
4282 BlueViking Vendor 587 1.663 216.0 4.0 November 11, 2013 2.326336 21
1900 DoctorX Sr. Member 285 0.748 214.0 3.0 October 11, 2013 2.324282 22
5872 Synergy Hero Member 904 2.490 219.0 13.0 October 29, 2013 2.313867 23
2551 sanrio1 Full Member 213 0.563 220.0 22.0 October 14, 2013 2.296665 24
5671 V Global Moderator 1063 2.768 230.0 33.0 October 08, 2013 2.294466 25
5503 Tessellated Vendor 737 2.042 215.0 23.0 October 30, 2013 2.283301 26
4028 fallingsnow Hero Member 2249 6.941 292.0 101.0 December 06, 2013 2.281033 27
3512 Loki Sr. Member 304 0.824 41.0 231.0 October 23, 2013 2.278754 28
2742 GroovyBruce Vendor 343 0.898 251.0 65.0 October 09, 2013 2.269513 29
3190 ACE Full Member 248 0.651 256.0 72.0 October 10, 2013 2.264818 30
5325 anontoker Hero Member 1137 2.969 214.0 33.0 October 09, 2013 2.257679 31
2984 r0guebubbles Hero Member 673 2.046 222.0 46.0 December 01, 2013 2.245513 32
1168 Nidge Vendor 281 0.774 194.0 19.0 October 29, 2013 2.243038 33
5603 Tryptamine Vendor 387 1.010 178.0 4.0 October 09, 2013 2.240549 34
4439 PillfirePharmacy Vendor 1342 4.079 236.0 63.0 December 02, 2013 2.238046 35
4226 plutopete Vendor 511 1.345 186.0 16.0 October 11, 2013 2.230449 36
2330 BigTenInch__Record Hero Member 1649 4.351 225.0 57.0 October 13, 2013 2.225309 37
4613 Lief Hero Member 622 1.620 241.0 74.0 October 08, 2013 2.222716 38
3969 Cirrus Global Moderator I am a geek!! 43464.288 196.0 31.0 October 06, 2013 2.217484 39
2022 coolvilla Hero Member 1734 5.630 278.0 115.0 December 23, 2013 2.212188 40
5084 Cornelius23 Hero Member 1350 3.571 219.0 56.0 October 13, 2013 2.212188 41
5162 Merde222 Hero Member 1714 5.290 296.0 134.0 December 07, 2013 2.209515 42
3590 Snowboarding Sr. Member 420 1.368 207.0 45.0 December 24, 2013 2.209515 43
6045 joenamath Hero Member 967 3.417 323.0 166.0 January 16, 2014 2.195900 44
3737 Ballzinator Full Member 155 0.407 168.0 15.0 October 11, 2013 2.184691 45
3521 JuicyMango Hero Member 511 1.464 181.0 31.0 November 12, 2013 2.176091 46
3197 lazybone Hero Member 697 2.293 182.0 33.0 December 27, 2013 2.173186 47
3276 worth-strut Hero Member 538 1.666 166.0 18.0 December 08, 2013 2.170262 48
2462 TragicallyHip Vendor 798 2.261 236.0 89.0 November 08, 2013 2.167317 49
5724 Sir William Wonka Hero Member 1667 4.352 226.0 81.0 October 09, 2013 2.161368 50

In [143]:
merge9['score'] = abs(merge9['up'] - merge9['down'])

count = -1
for each in merge9['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge9.set_value(count, 'score', order)

merge9_sort = merge9.sort_values(by='score', ascending=0)
merge9_sort = merge9_sort[merge9_sort.username != 'DoctorClu']
merge9_sort['rank'] = rank

In [144]:
merge9_sort[:20]


Out[144]:
username position posts ppd up down registered score rank
3664 Defcon Administrator 754 2.364 773.0 132.0 November 13, 2013 2.806858 1
4351 This Is Serious Mum Jr. Member 88 0.257 596.0 42.0 October 21, 2013 2.743510 2
2745 Hiniguel Hero Member 1794 5.111 680.0 153.0 October 12, 2013 2.721811 3
4675 The Jigsaw Puzzle Hero Member 2000 5.935 544.0 139.0 October 26, 2013 2.607455 4
5411 mary666 Hero Member 2339 6.760 492.0 92.0 October 09, 2013 2.602060 5
4742 Jack N Hoff Vendor 1955 5.618 517.0 122.0 October 14, 2013 2.596597 6
1837 murderface2012 Hero Member 1979 6.283 535.0 208.0 November 17, 2013 2.514548 7
2789 Tang Newbie Guide 4335 14.121 374.0 59.0 November 25, 2013 2.498311 8
3693 Alfred Hero Member 1027 2.968 323.0 31.0 October 09, 2013 2.465383 9
2979 ProEvo Hero Member 1222 3.522 308.0 37.0 October 08, 2013 2.432969 10
3978 shashimartell Sr. Member 392 1.133 292.0 33.0 October 14, 2013 2.413300 11
3628 VanillaRoyale Vendor 526 1.659 381.0 126.0 November 15, 2013 2.406540 12
2847 calcium345 Hero Member 1644 5.286 302.0 49.0 November 21, 2013 2.403121 13
3455 twatWaffle Hero Member 1297 3.685 298.0 70.0 October 08, 2013 2.357935 14
4812 Yoda Hero Member 1454 4.107 259.0 34.0 October 09, 2013 2.352183 15
5038 The President Hero Member 557 1.605 253.0 31.0 October 08, 2013 2.346353 16
5588 BoxofShapes Hero Member 848 2.395 235.0 22.0 October 09, 2013 2.328380 17
3815 Jolly Roger Hero Member 551 2.071 250.0 38.0 January 05, 2014 2.326336 18
4282 BlueViking Vendor 589 1.829 216.0 4.0 November 11, 2013 2.326336 19
1900 DoctorX Sr. Member 272 0.773 210.0 3.0 October 11, 2013 2.315970 20

In [145]:
merge8['score'] = abs(merge8['up'] - merge8['down'])

count = -1
for each in merge8['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge8.set_value(count, 'score', order)

merge8_sort = merge8.sort_values(by='score', ascending=0)
merge8_sort[:10]
merge8_sort = merge8_sort[merge8_sort.username != 'DoctorClu']
merge8_sort['rank'] = rank

In [146]:
merge8_sort[:20]


Out[146]:
username position posts ppd up down registered score rank
3664 Defcon Administrator 681 2.373 722.0 128.0 November 13, 2013 2.773786 1
2745 Hiniguel Hero Member 1794 5.624 677.0 152.0 October 12, 2013 2.720159 2
4351 This Is Serious Mum Jr. Member 94 0.303 551.0 34.0 October 21, 2013 2.713491 3
5411 mary666 Hero Member 2332 7.242 489.0 92.0 October 09, 2013 2.598791 4
4675 The Jigsaw Puzzle Hero Member 1760 5.770 483.0 127.0 October 26, 2013 2.551450 5
4742 Jack N Hoff Vendor 1506 4.766 426.0 115.0 October 14, 2013 2.492760 6
2789 Tang Newbie Guide 4021 14.622 362.0 53.0 November 25, 2013 2.489958 7
1837 murderface2012 Hero Member 1739 6.145 451.0 165.0 November 17, 2013 2.456366 8
3693 Alfred Hero Member 1026 3.186 312.0 31.0 October 09, 2013 2.448706 9
2979 ProEvo Hero Member 1223 3.786 305.0 37.0 October 08, 2013 2.428135 10
3628 VanillaRoyale Vendor 527 1.849 381.0 125.0 November 15, 2013 2.408240 11
2847 calcium345 Hero Member 1645 5.896 298.0 49.0 November 21, 2013 2.396199 12
3455 twatWaffle Hero Member 1295 4.022 297.0 70.0 October 08, 2013 2.356026 13
4812 Yoda Hero Member 1467 4.556 259.0 34.0 October 09, 2013 2.352183 14
3978 shashimartell Sr. Member 331 1.044 251.0 28.0 October 14, 2013 2.348305 15
5038 The President Hero Member 557 1.724 251.0 31.0 October 08, 2013 2.342423 16
5588 BoxofShapes Hero Member 847 2.630 235.0 22.0 October 09, 2013 2.328380 17
4282 BlueViking Vendor 589 2.038 216.0 4.0 November 11, 2013 2.326336 18
3815 Jolly Roger Hero Member 552 2.359 245.0 38.0 January 05, 2014 2.315970 19
5872 Synergy Global Moderator 906 3.000 216.0 13.0 October 29, 2013 2.307496 20

In [147]:
merge7['score'] = abs(merge7['up'] - merge7['down'])

count = -1
for each in merge7['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge7.set_value(count, 'score', order)

merge7_sort = merge7.sort_values(by='score', ascending=0)
merge7_sort = merge7_sort[merge7_sort.username != 'DoctorClu']
merge7_sort['rank'] = rank

In [148]:
merge7_sort[:20]


Out[148]:
username position posts ppd up down registered score rank
3664 Defcon Administrator 650 2.539 701.0 123.0 November 13, 2013 2.761928 1
2745 Hiniguel Hero Member 1797 6.261 674.0 152.0 October 12, 2013 2.717671 2
4351 This Is Serious Mum Jr. Member 86 0.309 510.0 31.0 October 21, 2013 2.680336 3
5411 mary666 Hero Member 2319 7.969 474.0 91.0 October 09, 2013 2.583199 4
4675 The Jigsaw Puzzle Hero Member 1585 5.806 411.0 102.0 October 26, 2013 2.489958 5
3693 Alfred Hero Member 1026 3.538 311.0 31.0 October 09, 2013 2.447158 6
2789 Tang Newbie Guide 3562 14.658 328.0 49.0 November 25, 2013 2.445604 7
1837 murderface2012 Hero Member 1577 6.283 408.0 133.0 November 17, 2013 2.439333 8
3628 VanillaRoyale Vendor 528 2.087 379.0 119.0 November 15, 2013 2.414973 9
2979 ProEvo Hero Member 1222 4.199 296.0 37.0 October 08, 2013 2.413300 10
2847 calcium345 Hero Member 1598 6.470 281.0 49.0 November 21, 2013 2.365488 11
4812 Yoda Hero Member 1468 5.062 259.0 34.0 October 09, 2013 2.352183 12
5038 The President Hero Member 557 1.914 250.0 31.0 October 08, 2013 2.340444 13
3455 twatWaffle Hero Member 1284 4.412 287.0 70.0 October 08, 2013 2.336460 14
4742 Jack N Hoff Vendor 875 3.070 308.0 96.0 October 14, 2013 2.326336 15
3978 shashimartell Sr. Member 318 1.116 235.0 26.0 October 14, 2013 2.320146 16
4282 BlueViking Vendor 589 2.283 212.0 4.0 November 11, 2013 2.318063 17
5588 BoxofShapes Hero Member 827 2.852 229.0 22.0 October 09, 2013 2.315970 18
5872 Synergy Global Moderator 907 3.347 216.0 12.0 October 29, 2013 2.309630 19
3815 Jolly Roger Hero Member 552 2.733 240.0 38.0 January 05, 2014 2.305351 20

In [149]:
merge6['score'] = abs(merge6['up'] - merge6['down'])

count = -1
for each in merge6['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge6.set_value(count, 'score', order)

merge6_sort = merge6.sort_values(by='score', ascending=0)
merge6_sort = merge6_sort[merge6_sort.username != 'DoctorClu']
merge6_sort['rank'] = rank

In [150]:
merge6_sort[:30]


Out[150]:
username position posts ppd up down registered score rank
3664 Defcon Administrator 569 2.507 670.0 117.0 November 13, 2013 2.742725 1
2745 Hiniguel Hero Member 1801 6.954 669.0 152.0 October 12, 2013 2.713491 2
4351 This Is Serious Mum Jr. Member 78 0.312 461.0 24.0 October 21, 2013 2.640481 3
5411 mary666 Hero Member 2281 8.706 464.0 86.0 October 09, 2013 2.577492 4
3693 Alfred Hero Member 1024 3.908 309.0 31.0 October 09, 2013 2.444045 5
1837 murderface2012 Hero Member 1459 6.543 377.0 106.0 November 17, 2013 2.432969 6
4675 The Jigsaw Puzzle Hero Member 1205 4.918 335.0 66.0 October 26, 2013 2.429752 7
2789 Tang Newbie Guide 3253 15.130 313.0 47.0 November 25, 2013 2.424882 8
2979 ProEvo Hero Member 1216 4.624 295.0 37.0 October 08, 2013 2.411620 9
3628 VanillaRoyale Vendor 521 2.316 371.0 114.0 November 15, 2013 2.409933 10
2847 calcium345 Hero Member 1571 7.174 273.0 45.0 November 21, 2013 2.357935 11
4812 Yoda Hero Member 1468 5.603 259.0 34.0 October 09, 2013 2.352183 12
5038 The President Hero Member 557 2.118 249.0 31.0 October 08, 2013 2.338456 13
3455 twatWaffle Hero Member 1286 4.890 287.0 70.0 October 08, 2013 2.336460 14
4282 BlueViking Vendor 574 2.496 209.0 3.0 November 11, 2013 2.313867 15
5872 Synergy Global Moderator 907 3.733 216.0 12.0 October 29, 2013 2.309630 16
5588 BoxofShapes Hero Member 781 2.981 222.0 20.0 October 09, 2013 2.305351 17
3815 Jolly Roger Hero Member 555 3.190 234.0 36.0 January 05, 2014 2.296665 18
3512 Loki Sr. Member 313 1.257 41.0 231.0 October 23, 2013 2.278754 19
1900 DoctorX Full Member 229 0.881 189.0 2.0 October 11, 2013 2.271842 20
3978 shashimartell Sr. Member 285 1.109 210.0 24.0 October 14, 2013 2.269513 21
2742 GroovyBruce Vendor 352 1.344 249.0 63.0 October 09, 2013 2.269513 22
5503 Tessellated Vendor 712 2.954 206.0 23.0 October 30, 2013 2.262451 23
3190 ACE Vendor 715 2.739 222.0 39.0 October 10, 2013 2.262451 24
4742 Jack N Hoff Vendor 692 2.693 238.0 57.0 October 14, 2013 2.257679 25
5671 V Global Moderator 757 2.957 207.0 27.0 October 08, 2013 2.255273 26
5300 bodnostrokulum Sr. Member 330 1.304 220.0 46.0 October 18, 2013 2.240549 27
2984 r0guebubbles Hero Member 684 3.273 217.0 46.0 December 01, 2013 2.232996 28
2330 BigTenInch__Record Hero Member 1674 6.463 224.0 56.0 October 13, 2013 2.225309 29
2551 sanrio1 Full Member 189 0.733 188.0 20.0 October 14, 2013 2.225309 30

In [151]:
merge5['score'] = abs(merge5['up'] - merge5['down'])

count = -1
for each in merge5['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge5.set_value(count, 'score', order)

merge5_sort = merge5.sort_values(by='score', ascending=0)
merge5_sort = merge5_sort[merge5_sort.username != 'DoctorClu']
merge5_sort['rank'] = rank

In [55]:
merge4['score'] = abs(merge4['up'] - merge4['down'])

count = -1
for each in merge4['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge4.set_value(count, 'score', order)

merge4_sort = merge4.sort_values(by='score', ascending=0)
merge4_sort = merge4_sort[merge4_sort.username != 'DoctorClu']
merge4_sort['rank'] = rank

In [56]:
merge3['score'] = abs(merge3['up'] - merge3['down'])

count = -1
for each in merge3['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge3.set_value(count, 'score', order)

merge3_sort = merge3.sort_values(by='score', ascending=0)
merge3_sort = merge3_sort[merge3_sort.username != 'DoctorClu']
merge3_sort['rank'] = rank

In [57]:
merge2['score'] = abs(merge2['up'] - merge2['down'])

count = -1
for each in merge2['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge2.set_value(count, 'score', order)

merge2_sort = merge2.sort_values(by='score', ascending=0)
merge2_sort = merge2_sort[merge2_sort.username != 'DoctorClu']
merge2_sort['rank'] = rank

In [58]:
merge1['score'] = abs(merge1['up'] - merge1['down'])

count = -1
for each in merge1['score']:
    count = count + 1
    order = log(max(each, 1), 10)
    merge1.set_value(count, 'score', order)

merge1_sort = merge1.sort_values(by='score', ascending=0)
merge1_sort = merge1_sort[merge1_sort.username != 'DoctorClu']
merge1_sort['rank'] = rank

In [59]:
#merge11_sort[merge11_sort.username == top20[0]]['rank']
a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[0]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[0]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[0]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[0]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[0]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[0]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[0]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[0]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[0]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[0]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[0]]
top1rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [60]:
a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[1]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[1]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[1]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[1]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[1]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[1]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[1]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[1]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[1]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[1]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[1]]
top2rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [61]:
a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[2]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[2]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[2]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[2]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[2]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[2]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[2]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[2]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[2]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[2]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[2]]
top3rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [62]:
a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[3]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[3]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[3]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[3]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[3]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[3]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[3]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[3]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[3]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[3]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[3]]
top4rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [63]:
a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[4]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[4]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[4]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[4]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[4]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[4]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[4]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[4]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[4]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[4]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[4]]
top5rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [64]:
a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[5]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[5]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[5]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[5]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[5]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[5]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[5]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[5]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[5]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[5]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[5]]
top6rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[6]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[6]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[6]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[6]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[6]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[6]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[6]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[6]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[6]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[6]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[6]]
top7rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[7]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[7]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[7]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[7]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[7]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[7]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[7]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[7]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[7]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[7]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[7]]
top8rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[8]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[8]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[8]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[8]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[8]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[8]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[8]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[8]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[8]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[8]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[8]]
top9rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [65]:
a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[9]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[9]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[9]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[9]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[9]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[9]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[9]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[9]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[9]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[9]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[9]]
top10rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[10]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[10]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[10]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[10]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[10]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[10]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[10]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[10]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[10]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[10]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[10]]
top11rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[11]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[11]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[11]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[11]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[11]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[11]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[11]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[11]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[11]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[11]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[11]]
top12rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[12]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[12]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[12]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[12]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[12]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[12]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[12]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[12]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[12]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[12]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[12]]
top13rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [66]:
a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[13]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[13]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[13]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[13]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[13]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[13]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[13]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[13]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[13]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[13]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[13]]
top14rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[14]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[14]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[14]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[14]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[14]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[14]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[14]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[14]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[14]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[14]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[14]]
top15rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[15]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[15]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[15]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[15]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[15]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[15]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[15]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[15]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[15]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[15]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[15]]
top16rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[16]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[16]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[16]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[16]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[16]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[16]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[16]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[16]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[16]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[16]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[16]]
top17rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])


a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[17]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[17]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[17]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[17]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[17]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[17]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[17]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[17]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[17]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[17]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[17]]
top18rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[18]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[18]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[18]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[18]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[18]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[18]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[18]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[18]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[18]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[18]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[18]]
top19rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['rank'].values[merge1_sort['username'].values == top20[19]]
b = merge2_sort['rank'].values[merge2_sort['username'].values == top20[19]]
c = merge3_sort['rank'].values[merge3_sort['username'].values == top20[19]]
d = merge4_sort['rank'].values[merge4_sort['username'].values == top20[19]]
e = merge5_sort['rank'].values[merge5_sort['username'].values == top20[19]]
f = merge6_sort['rank'].values[merge6_sort['username'].values == top20[19]]
g = merge7_sort['rank'].values[merge7_sort['username'].values == top20[19]]
h = merge8_sort['rank'].values[merge8_sort['username'].values == top20[19]]
i = merge9_sort['rank'].values[merge9_sort['username'].values == top20[19]]
j = merge10_sort['rank'].values[merge10_sort['username'].values == top20[19]]
k = merge11_sort['rank'].values[merge11_sort['username'].values == top20[19]]
top20rank = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [67]:
data = {top20[0]: top1rank, top20[1]: top2rank, top20[2]: top3rank, top20[3]: top4rank, top20[4]: top5rank,
        top20[5]: top6rank, top20[6]: top7rank, top20[7]: top8rank, top20[8]: top9rank, top20[9]: top10rank,
        top20[10]: top11rank, top20[11]: top12rank, top20[12]: top13rank, top20[13]: top14rank, top20[14]: top15rank,
        top20[15]: top16rank, top20[16]: top17rank, top20[17]: top18rank, top20[18]: top19rank, top20[19]: top20rank}
totalRank = pd.DataFrame(data)

In [68]:
totalRank['date'] = {'201401', '201402', '201403', '201404', '201405', '201406', '201407', '201408', '201409', '201410', '201411'}

In [69]:
totalRank.to_csv('totalrank.tsv', sep='\t', encoding='utf-8')

In [70]:
totalRank = totalRank.set_index('date')

In [71]:
top20


Out[71]:
array(['Defcon', 'This Is Serious Mum', 'Hiniguel', 'Jack N Hoff',
       'The Jigsaw Puzzle', 'mary666', 'murderface2012', 'Tang', 'Alfred',
       'shashimartell', 'ProEvo', 'calcium345', 'VanillaRoyale',
       'twatWaffle', 'The President', 'bodnostrokulum', 'Yoda',
       'BoxofShapes', 'Jolly Roger', 'DoctorX'], dtype=object)

In [72]:
totalRank


Out[72]:
Alfred BoxofShapes Defcon DoctorX Hiniguel Jack N Hoff Jolly Roger ProEvo Tang The Jigsaw Puzzle The President This Is Serious Mum VanillaRoyale Yoda bodnostrokulum calcium345 mary666 murderface2012 shashimartell twatWaffle
date
201403 4 19 3 48 2 15 59 5 12 138 7 9 13 14 20 11 6 22 31 38
201402 3 25 2 45 1 14 23 5 12 76 8 6 7 11 18 10 4 21 36 15
201401 4 33 2 44 1 16 19 6 13 50 8 5 7 11 22 9 3 18 35 12
201407 5 22 2 36 1 26 17 7 10 15 11 3 6 9 28 8 4 14 31 12
201411 6 21 2 23 1 32 19 8 9 11 14 4 7 13 28 12 5 10 31 15
201405 5 17 1 20 2 25 18 9 8 7 13 3 10 12 27 11 4 6 21 14
201404 6 18 1 21 2 15 20 10 7 5 13 3 9 12 23 11 4 8 16 14
201409 9 17 1 21 2 6 19 10 7 5 16 3 11 14 25 12 4 8 15 13
201408 9 17 1 20 3 6 18 10 8 4 16 2 12 15 23 13 5 7 11 14
201410 9 18 1 22 3 4 19 11 8 5 17 2 13 15 16 12 6 7 10 14
201406 9 18 1 20 3 4 19 11 8 5 15 2 13 17 16 12 6 7 10 14

In [73]:
top3rank


Out[73]:
array([2, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3])

In [74]:
a = merge1_sort['score'].values[merge1_sort['username'].values == top20[0]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[0]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[0]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[0]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[0]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[0]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[0]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[0]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[0]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[0]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[0]]
top1score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[1]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[1]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[1]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[1]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[1]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[1]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[1]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[1]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[1]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[1]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[1]]
top2score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[2]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[2]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[2]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[2]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[2]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[2]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[2]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[2]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[2]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[2]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[2]]
top3score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[3]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[3]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[3]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[3]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[3]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[3]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[3]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[3]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[3]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[3]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[3]]
top4score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[4]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[4]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[4]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[4]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[4]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[4]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[4]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[4]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[4]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[4]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[4]]
top5score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[5]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[5]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[5]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[5]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[5]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[5]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[5]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[5]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[5]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[5]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[5]]
top6score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[6]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[6]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[6]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[6]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[6]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[6]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[6]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[6]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[6]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[6]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[6]]
top7score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[7]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[7]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[7]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[7]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[7]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[7]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[7]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[7]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[7]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[7]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[7]]
top8score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[8]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[8]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[8]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[8]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[8]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[8]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[8]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[8]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[8]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[8]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[8]]
top9score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[9]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[9]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[9]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[9]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[9]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[9]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[9]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[9]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[9]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[9]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[9]]
top10score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[10]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[10]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[10]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[10]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[10]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[10]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[10]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[10]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[10]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[10]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[10]]
top11score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[11]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[11]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[11]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[11]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[11]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[11]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[11]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[11]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[11]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[11]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[11]]
top12score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[12]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[12]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[12]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[12]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[12]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[12]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[12]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[12]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[12]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[12]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[12]]
top13score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[13]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[13]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[13]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[13]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[13]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[13]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[13]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[13]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[13]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[13]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[13]]
top14score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[14]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[14]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[14]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[14]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[14]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[14]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[14]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[14]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[14]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[14]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[14]]
top15score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[15]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[15]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[15]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[15]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[15]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[15]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[15]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[15]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[15]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[15]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[15]]
top16score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[16]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[16]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[16]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[16]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[16]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[16]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[16]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[16]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[16]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[16]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[16]]
top17score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])


a = merge1_sort['score'].values[merge1_sort['username'].values == top20[17]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[17]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[17]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[17]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[17]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[17]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[17]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[17]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[17]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[17]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[17]]
top18score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[18]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[18]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[18]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[18]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[18]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[18]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[18]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[18]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[18]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[18]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[18]]
top19score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

a = merge1_sort['score'].values[merge1_sort['username'].values == top20[19]]
b = merge2_sort['score'].values[merge2_sort['username'].values == top20[19]]
c = merge3_sort['score'].values[merge3_sort['username'].values == top20[19]]
d = merge4_sort['score'].values[merge4_sort['username'].values == top20[19]]
e = merge5_sort['score'].values[merge5_sort['username'].values == top20[19]]
f = merge6_sort['score'].values[merge6_sort['username'].values == top20[19]]
g = merge7_sort['score'].values[merge7_sort['username'].values == top20[19]]
h = merge8_sort['score'].values[merge8_sort['username'].values == top20[19]]
i = merge9_sort['score'].values[merge9_sort['username'].values == top20[19]]
j = merge10_sort['score'].values[merge10_sort['username'].values == top20[19]]
k = merge11_sort['score'].values[merge11_sort['username'].values == top20[19]]
top20score = np.concatenate([a,b,c,d,e,f,g,h,i,j,k])

In [75]:
data = {top20[0]: top1score, top20[1]: top2score, top20[2]: top3score, top20[3]: top4score, top20[4]: top5score,
        top20[5]: top6score, top20[6]: top7score, top20[7]: top8score, top20[8]: top9score, top20[9]: top10score,
        top20[10]: top11score, top20[11]: top12score, top20[12]: top13score, top20[13]: top14score, top20[14]: top15score,
        top20[15]: top16score, top20[16]: top17score, top20[17]: top18score, top20[18]: top19score, top20[19]: top20score}
totalScore = pd.DataFrame(data)

In [76]:
totalScore.to_csv('totalscore.tsv', sep='\t', encoding='utf-8')

In [77]:
memberType = df_1.position.unique()

In [78]:
member1 = [] # newbie
member1.append(df_1[df_1['position'] == memberType[1]].count().values[0]) # jan newbie
member1.append(df_2[df_2['position'] == memberType[1]].count().values[0]) # feb newbie
member1.append(df_3[df_3['position'] == memberType[1]].count().values[0]) # jan newbie
member1.append(df_4[df_4['position'] == memberType[1]].count().values[0]) # feb newbie
member1.append(df_5[df_5['position'] == memberType[1]].count().values[0]) # jan newbie
member1.append(df_6[df_6['position'] == memberType[1]].count().values[0]) # feb newbie
member1.append(df_7[df_7['position'] == memberType[1]].count().values[0]) # jan newbie
member1.append(df_8[df_8['position'] == memberType[1]].count().values[0]) # feb newbie
member1.append(df_9[df_9['position'] == memberType[1]].count().values[0]) # jan newbie
member1.append(df_10[df_10['position'] == memberType[1]].count().values[0]) # jan newbie
member1.append(df_11[df_11['position'] == memberType[1]].count().values[0]) # feb newbie

member2 = [] # jr. member
member2.append(df_1[df_1['position'] == memberType[0]].count().values[0]) # jan newbie
member2.append(df_2[df_2['position'] == memberType[0]].count().values[0]) # feb newbie
member2.append(df_3[df_3['position'] == memberType[0]].count().values[0]) # jan newbie
member2.append(df_4[df_4['position'] == memberType[0]].count().values[0]) # feb newbie
member2.append(df_5[df_5['position'] == memberType[0]].count().values[0]) # jan newbie
member2.append(df_6[df_6['position'] == memberType[0]].count().values[0]) # feb newbie
member2.append(df_7[df_7['position'] == memberType[0]].count().values[0]) # jan newbie
member2.append(df_8[df_8['position'] == memberType[0]].count().values[0]) # feb newbie
member2.append(df_9[df_9['position'] == memberType[0]].count().values[0]) # jan newbie
member2.append(df_10[df_10['position'] == memberType[0]].count().values[0]) # jan newbie
member2.append(df_11[df_11['position'] == memberType[0]].count().values[0]) # feb newbie

#member1m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member2m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member3m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member4m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member5m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member6m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member7m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member8m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member9m1 = df_1[df_1['position'] == memberType[0]].count().values[0]
#member10m1 = df_1[df_1['position'] == memberType[0]].count().values[0]

In [79]:
member1


Out[79]:
[4064, 9077, 9336, 10709, 11532, 12316, 13278, 14098, 14819, 15578, 15608]

In [80]:
member2


Out[80]:
[1852, 2969, 3131, 3706, 3971, 4341, 4636, 4877, 5130, 5374, 5384]

In [81]:
memberType


Out[81]:
array(['Jr. Member', 'Newbie', 'Vendor', 'Full Member', 'Journalist',
       'Sr. Member', 'Administrator', 'Hero Member', 'Newbie Guide',
       'Global Moderator', 'SR Dev'], dtype=object)

In [82]:
member3 = [] # FULL. member
member3.append(df_1[df_1['position'] == memberType[3]].count().values[0]) # jan newbie
member3.append(df_2[df_2['position'] == memberType[3]].count().values[0]) # feb newbie
member3.append(df_3[df_3['position'] == memberType[3]].count().values[0]) # jan newbie
member3.append(df_4[df_4['position'] == memberType[3]].count().values[0]) # feb newbie
member3.append(df_5[df_5['position'] == memberType[3]].count().values[0]) # jan newbie
member3.append(df_6[df_6['position'] == memberType[3]].count().values[0]) # feb newbie
member3.append(df_7[df_7['position'] == memberType[3]].count().values[0]) # jan newbie
member3.append(df_8[df_8['position'] == memberType[3]].count().values[0]) # feb newbie
member3.append(df_9[df_9['position'] == memberType[3]].count().values[0]) # jan newbie
member3.append(df_10[df_10['position'] == memberType[3]].count().values[0]) # jan newbie
member3.append(df_11[df_11['position'] == memberType[3]].count().values[0]) # feb newbie

In [83]:
member3


Out[83]:
[373, 523, 578, 687, 733, 799, 816, 863, 912, 929, 932]

In [84]:
member4 = [] # jr. member
member4.append(df_1[df_1['position'] == memberType[5]].count().values[0]) # jan newbie
member4.append(df_2[df_2['position'] == memberType[5]].count().values[0]) # feb newbie
member4.append(df_3[df_3['position'] == memberType[5]].count().values[0]) # jan newbie
member4.append(df_4[df_4['position'] == memberType[5]].count().values[0]) # feb newbie
member4.append(df_5[df_5['position'] == memberType[5]].count().values[0]) # jan newbie
member4.append(df_6[df_6['position'] == memberType[5]].count().values[0]) # feb newbie
member4.append(df_7[df_7['position'] == memberType[5]].count().values[0]) # jan newbie
member4.append(df_8[df_8['position'] == memberType[5]].count().values[0]) # feb newbie
member4.append(df_9[df_9['position'] == memberType[5]].count().values[0]) # jan newbie
member4.append(df_10[df_10['position'] == memberType[5]].count().values[0]) # jan newbie
member4.append(df_11[df_11['position'] == memberType[5]].count().values[0]) # feb newbie

In [85]:
member4


Out[85]:
[81, 116, 126, 146, 160, 187, 197, 199, 211, 224, 225]

In [86]:
member5 = [] # jr. member
member5.append(df_1[df_1['position'] == memberType[7]].count().values[0]) # jan newbie
member5.append(df_2[df_2['position'] == memberType[7]].count().values[0]) # feb newbie
member5.append(df_3[df_3['position'] == memberType[7]].count().values[0]) # jan newbie
member5.append(df_4[df_4['position'] == memberType[7]].count().values[0]) # feb newbie
member5.append(df_5[df_5['position'] == memberType[7]].count().values[0]) # jan newbie
member5.append(df_6[df_6['position'] == memberType[7]].count().values[0]) # feb newbie
member5.append(df_7[df_7['position'] == memberType[7]].count().values[0]) # jan newbie
member5.append(df_8[df_8['position'] == memberType[7]].count().values[0]) # feb newbie
member5.append(df_9[df_9['position'] == memberType[7]].count().values[0]) # jan newbie
member5.append(df_10[df_10['position'] == memberType[7]].count().values[0]) # jan newbie
member5.append(df_11[df_11['position'] == memberType[7]].count().values[0]) # feb newbie

In [87]:
member5


Out[87]:
[35, 55, 61, 81, 88, 94, 100, 110, 127, 136, 138]

In [88]:
member6 = [] # jr. member
member6.append(df_1[df_1['position'] == memberType[2]].count().values[0]) # jan newbie
member6.append(df_2[df_2['position'] == memberType[2]].count().values[0]) # feb newbie
member6.append(df_3[df_3['position'] == memberType[2]].count().values[0]) # jan newbie
member6.append(df_4[df_4['position'] == memberType[2]].count().values[0]) # feb newbie
member6.append(df_5[df_5['position'] == memberType[2]].count().values[0]) # jan newbie
member6.append(df_6[df_6['position'] == memberType[2]].count().values[0]) # feb newbie
member6.append(df_7[df_7['position'] == memberType[2]].count().values[0]) # jan newbie
member6.append(df_8[df_8['position'] == memberType[2]].count().values[0]) # feb newbie
member6.append(df_9[df_9['position'] == memberType[2]].count().values[0]) # jan newbie
member6.append(df_10[df_10['position'] == memberType[2]].count().values[0]) # jan newbie
member6.append(df_11[df_11['position'] == memberType[2]].count().values[0]) # feb newbie

In [93]:
member6


Out[93]:
[421, 461, 459, 522, 480, 489, 501, 459, 464, 467, 464]

In [90]:



  File "<ipython-input-90-4eb5d9464665>", line 1
    df_1[df_1['position'] == memberType[4]].count().values[0] +
                                                                ^
SyntaxError: invalid syntax

In [91]:
other1 = 0
other1 += df_1[df_1['position'] == memberType[4]].count().values[0]
other1 += df_1[df_1['position'] == memberType[6]].count().values[0]
other1 += df_1[df_1['position'] == memberType[8]].count().values[0]
other1 += df_1[df_1['position'] == memberType[9]].count().values[0]
other1 += df_1[df_1['position'] == memberType[10]].count().values[0]

In [92]:
other1


Out[92]:
18

In [165]:
other2 = 0
other2 += df_2[df_2['position'] == memberType[4]].count().values[0]
other2 += df_2[df_2['position'] == memberType[6]].count().values[0]
other2 += df_2[df_2['position'] == memberType[8]].count().values[0]
other2 += df_2[df_2['position'] == memberType[9]].count().values[0]
other2 += df_2[df_2['position'] == memberType[10]].count().values[0]
other2


Out[165]:
18

In [167]:
other3 = 0
other3 += df_3[df_3['position'] == memberType[4]].count().values[0]
other3 += df_3[df_3['position'] == memberType[6]].count().values[0]
other3 += df_3[df_3['position'] == memberType[8]].count().values[0]
other3 += df_3[df_3['position'] == memberType[9]].count().values[0]
other3 += df_3[df_3['position'] == memberType[10]].count().values[0]
other3


Out[167]:
18

In [169]:
other4 = 0
other4 += df_4[df_4['position'] == memberType[4]].count().values[0]
other4 += df_4[df_4['position'] == memberType[6]].count().values[0]
other4 += df_4[df_4['position'] == memberType[8]].count().values[0]
other4 += df_4[df_4['position'] == memberType[9]].count().values[0]
other4 += df_4[df_4['position'] == memberType[10]].count().values[0]
other4


Out[169]:
19

In [170]:
other5 = 0
other5 += df_5[df_5['position'] == memberType[4]].count().values[0]
other5 += df_5[df_5['position'] == memberType[6]].count().values[0]
other5 += df_5[df_5['position'] == memberType[8]].count().values[0]
other5 += df_5[df_5['position'] == memberType[9]].count().values[0]
other5 += df_5[df_5['position'] == memberType[10]].count().values[0]
other5


Out[170]:
19

In [181]:
other6 = 0
other6 += df_6[df_6['position'] == memberType[4]].count().values[0]
other6 += df_6[df_6['position'] == memberType[6]].count().values[0]
other6 += df_6[df_6['position'] == memberType[8]].count().values[0]
other6 += df_6[df_6['position'] == memberType[9]].count().values[0]
other6 += df_6[df_6['position'] == memberType[10]].count().values[0]
other6


Out[181]:
22

In [182]:
other7 = 0
other7 += df_7[df_7['position'] == memberType[4]].count().values[0]
other7 += df_7[df_7['position'] == memberType[6]].count().values[0]
other7 += df_7[df_7['position'] == memberType[8]].count().values[0]
other7 += df_7[df_7['position'] == memberType[9]].count().values[0]
other7 += df_7[df_7['position'] == memberType[10]].count().values[0]
other7


Out[182]:
23

In [183]:
other8 = 0
other8 += df_8[df_8['position'] == memberType[4]].count().values[0]
other8 += df_8[df_8['position'] == memberType[6]].count().values[0]
other8 += df_8[df_8['position'] == memberType[8]].count().values[0]
other8 += df_8[df_8['position'] == memberType[9]].count().values[0]
other8 += df_8[df_8['position'] == memberType[10]].count().values[0]
other8


Out[183]:
24

In [184]:
other9 = 0
other9 += df_9[df_9['position'] == memberType[4]].count().values[0]
other9 += df_9[df_9['position'] == memberType[6]].count().values[0]
other9 += df_9[df_9['position'] == memberType[8]].count().values[0]
other9 += df_9[df_9['position'] == memberType[9]].count().values[0]
other9 += df_9[df_9['position'] == memberType[10]].count().values[0]
other9


Out[184]:
24

In [185]:
other10 = 0
other10 += df_10[df_10['position'] == memberType[4]].count().values[0]
other10 += df_10[df_10['position'] == memberType[6]].count().values[0]
other10 += df_10[df_10['position'] == memberType[8]].count().values[0]
other10 += df_10[df_10['position'] == memberType[9]].count().values[0]
other10 += df_10[df_10['position'] == memberType[10]].count().values[0]
other10


Out[185]:
20

In [186]:
other11 = 0
other11 += df_11[df_11['position'] == memberType[4]].count().values[0]
other11 += df_11[df_11['position'] == memberType[6]].count().values[0]
other11 += df_11[df_11['position'] == memberType[8]].count().values[0]
other11 += df_11[df_11['position'] == memberType[9]].count().values[0]
other11 += df_11[df_11['position'] == memberType[10]].count().values[0]
other11


Out[186]:
19

In [94]:
# add month recorded in prep for concatenation of all data
#merge1['monthRecorded'] = 'January'
#merge2['monthRecorded'] = 'February'
#merge3['monthRecorded'] = 'March'
#merge4['monthRecorded'] = 'April'
#merge5['monthRecorded'] = 'May'
#merge6['monthRecorded'] = 'June'
#merge7['monthRecorded'] = 'July'
#merge8['monthRecorded'] = 'August'
#merge9['monthRecorded'] = 'September'
#merge10['monthRecorded'] = 'October'
#merge11['monthRecorded'] = 'November'

# append all records to each other
result = merge1.append(merge2).append(merge3).append(merge4).append(merge5).append(merge6).append(merge7).append(merge8).append(merge9).append(merge10).append(merge11)
result['position'].unique()


Out[94]:
array(['Jr. Member', 'Newbie', 'Vendor', 'Full Member', 'Journalist',
       'Sr. Member', 'Administrator', 'Hero Member', 'Newbie Guide',
       'Global Moderator', 'SR Dev'], dtype=object)

In [95]:
# Remove Newbies, Jr. Members, and irregular users "DoctorClu" and "Cirrus".
# Also perform anonymization of usernames using a dictionary so values are consistent across months.

# create a new set to store unique usernames
uniqueUsername = set()
for username in result.username :
    uniqueUsername.add(username)
# create a dictionary that contains mappings between unique usernames as keys and anonymized strings as values
anonUserNames = {}
for i, username in enumerate(uniqueUsername):
    #print(i, username)
    anonUserNames[username] = "User" + str(i)

# anonymization function
def anonymize(originalUsername):
    return anonUserNames[originalUsername]

merges = [merge1, merge2, merge3, merge4, merge5, merge6, merge7, merge8, merge9, merge10, merge11]
for i in xrange(len(merges)):
    merges[i] = merges[i][merges[i].position != "Newbie"]
    merges[i] = merges[i][merges[i].position != "Jr. Member"]
    merges[i] = merges[i][merges[i].username != "DoctorClu"]
    merges[i] = merges[i][merges[i].username != "Cirrus"]
    # perform anonymization of usernames
    merges[i]['username'] = merges[i]['username'].apply(anonymize)

In [98]:
top20result = merge11_sort[:20]

In [108]:
uniqueUsername = set()
for username in top20result.username :
    uniqueUsername.add(username)

anonUserNames = {}
for i, username in enumerate(uniqueUsername):
    anonUserNames[username] = "User" + str(i)
    
def anonymize(originalUsername):
    return anonUserNames[originalUsername]

top20result['username'] = top20result['username'].apply(anonymize)


/Users/PIGGY/anaconda/lib/python2.7/site-packages/ipykernel/__main__.py:12: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

In [109]:
top20result


Out[109]:
username position posts ppd up down registered score rank
3664 User8 Administrator 786 2.208 806.0 136.0 November 13, 2013 2.826075 1
4351 User12 Jr. Member 83 0.219 668.0 55.0 October 21, 2013 2.787460 2
2745 User4 Hero Member 1778 4.582 683.0 153.0 October 12, 2013 2.724276 3
4742 User11 Vendor 2087 5.407 607.0 133.0 October 14, 2013 2.675778 4
4675 User19 Hero Member 2277 6.088 618.0 189.0 October 26, 2013 2.632457 5
5411 User9 Hero Member 2383 6.095 508.0 92.0 October 09, 2013 2.619093 6
1837 User0 Hero Member 1672 4.750 633.0 235.0 November 17, 2013 2.599883 7
2789 User2 Newbie Guide 4699 13.660 406.0 66.0 November 25, 2013 2.531479 8
3693 User1 Hero Member 1030 2.634 340.0 31.0 October 09, 2013 2.489958 9
3978 User13 Sr. Member 444 1.150 336.0 37.0 October 14, 2013 2.475671 10
2979 User6 Hero Member 1221 3.115 308.0 37.0 October 08, 2013 2.432969 11
2847 User3 Hero Member 1644 4.724 302.0 49.0 November 21, 2013 2.403121 12
3628 User5 Vendor 527 1.489 381.0 129.0 November 15, 2013 2.401401 13
3455 User16 Hero Member 1291 3.293 298.0 71.0 October 08, 2013 2.356026 14
5038 User10 Hero Member 557 1.421 256.0 31.0 October 08, 2013 2.352183 15
5300 User15 Sr. Member 377 0.987 275.0 50.0 October 18, 2013 2.352183 16
4812 User18 Hero Member 1452 3.714 260.0 35.0 October 09, 2013 2.352183 17
5588 User14 Hero Member 899 2.299 244.0 22.0 October 09, 2013 2.346353 18
3815 User7 Hero Member 551 1.818 259.0 38.0 January 05, 2014 2.344392 19
1900 User17 Sr. Member 289 0.743 216.0 3.0 October 11, 2013 2.328380 20

In [112]:



Out[112]:
array(['User8', 'User12', 'User4', 'User11', 'User19', 'User9', 'User0',
       'User2', 'User1', 'User13', 'User6', 'User3', 'User5', 'User16',
       'User10', 'User15', 'User18', 'User14', 'User7', 'User17'], dtype=object)

In [ ]: